Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello, It is about C-Sharp, .NET 3.5 application. I'm trying to play a wav file embedded in my application. Here is my not working code (no exceptions, it just doesn't play the wav): Assembly assembly = Assembly.GetExecutingAssembly(); What am I doing wrong? |
||||
|
Doesn't work for me either. |
||||
|
Bump. Admin please add a "sharp" sign or word to the subject. It didn't save a sharp sign when I created a topic. |
||||
|
Not sure there. Any error message? Maybe you are trying to play back an unsupported wave file (with an unsupported compression format), did you try another one? BTW: Yes, this forum doesn't like the sharp sign, sorry :) |
||||
|
I left this issue for some time, but today I came back to and was able to resolve it. niko was right, the wav file I tried to embed and play had unsupported compression format. As a man not familiar with sound encodings at all I found it just by accident. I played with project CSharp.03.MemoryPlayback from examples.net. I converted the initial wav file I couldn't play from the stream to DataArray with bin2h tool (http://www.deadnode.org/sw/bin2h/) and replaced the SoundDataArray with my data in that example. At some point I received a message in console that "The wav has unsupported MPEGLAYER3 encoding and only PCM encoding is currently supported", though it played the wav (SoundDataArray) anyway. I went from there and searched how to convert MPEGLAYER3 wav file to PCM wav file. I found that it can be done with FFMPEG tool (http://ffmpeg.zeranoe.com/builds/ ---- windows builds) with the follwing command: "ffmpeg -i source.wav -f wav -acodec pcm_s16le dest.wav". The source.wav file was the one I couldn't play from the stream after embedding file in my application and the dest.wav is the one I was able to embed and play from the stream in my application. The size of the initial source.wav was 20kb, the size after conversion to the dest.wav became 176kb. I also was always able to play the initial sourse.wav from file. It didn't work only when I tried to embed and play it from a stream. |
||||
|
Em... I've just updated irrKlang library and now it works even with my initial source.wav I couldn't play from the stream before. May be some bugs were fixed in irrKlang, may be I did something wrong the first time I encountered this problem. Anyway now it just works. |
|