ravi.joshi53's picture

Cgen.Audio is not playing SOME of the wav files

I got mp3 files from internet which I converted online to wav file format. I have noticed that Cgen.Audio is not able to play these files.

Can anyone please tell me the workaround for the same?

Thanks


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

You will probably get a faster response if you report an issue at cgaudio and upload one of these wav files for testing.

What does "not able to play these files" mean? Is Cgen.Audio throwing an exception? If so, post a stacktrace (preferably from a debug build of Cgen.Audio.) Is it playing silence? Playing the files too fast?

The more information you can give about the problem, the better the chances someone will be able to help you.

Another thing you could try is converting the mp3 files using Audacity. This lets you set the parameters of the output file to e.g. 44KHz, 16bit, mono, which should be supported by Cgen.Audio.

ravi.joshi53's picture
the Fiddler wrote:

You will probably get a faster response if you report an issue at cgaudio and upload one of these wav files for testing.

Sadly, Cgen.Audio doesn't respond to any query. Really sorry for asking this question here. I have attached a testing wave file, which can be found from here

the Fiddler wrote:

What does "not able to play these files" mean? Is Cgen.Audio throwing an exception? If so, post a stacktrace (preferably from a debug build of Cgen.Audio.) Is it playing silence? Playing the files too fast?

it is playing silence. However I can hear the sound, whenever I use window media player. Cgen.Audio is playing silence and not throwing any exception. The program runs smoothly without any audio.

the Fiddler wrote:

Another thing you could try is converting the mp3 files using Audacity. This lets you set the parameters of the output file to e.g. 44KHz, 16bit, mono, which should be supported by Cgen.Audio.

Sure, I'll do it right away.

Thanks for the help. Much appreciated.

ravi.joshi53's picture

Hi Fiddler,

As suggested by you, converting files to the above settings resolved the problem.... Thanks a lot for the quick help.

CXO2's picture

I am sorry for really2 late reply
kinda busy with school stuffs lol

try to see the Output window in your IDE.
And I tested it, and i got this error:

Error: [SoundSystem.cs(Load:357)] 'data' header not found.
Error: [Sound.cs(.ctor:78)] [Sound: }

make sure there "WAVE", "fmt" and "data" on ur wave header
Check this link for more details about wave header: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/

Alternatively, you can edit and compile the Cgen.Audio source from the codeplex site.
The SoundSystem.Load(byte[] wavdata, out byte[] parsedData, out WaveHeader header) part, its kinda "non header-friendly" lol