Sound Playing error
- accucore12
- Posts: 14
- Joined: May 18th, 2012, 1:06 pm
Sound Playing error
Can someone help me with this error? I am trying to add sound using the sound.h provided in the framework.
Here is what i added in order to add sound.Not sure if i did it correctly or left out any important steps. The wave file that i am trying to play is 705kbps.
Added this in game.h
private:
Sound lose;
In the constructor of Game::Game
lose = audio.CreateSound( "Lose.wav" );
In my execution code ,
lose.Play( -1000 );//anyway what does the -1000 mean?
I found some clues in the sound.cpp file but have no idea on how to edit it.
Sound.cpp
// In this case it is a .WAV file recorded at 44,100 samples per second in 16-bit stereo (cd audio format).
waveFormat.wFormatTag = WAVE_FORMAT_PCM;
waveFormat.nSamplesPerSec = //44100;
waveFormat.wBitsPerSample = 16;
Last edited by accucore12 on May 20th, 2012, 7:16 pm, edited 1 time in total.
Code: Select all
Occupation: Reverse Engineer
Re: Sound Playing error
The music files kilo bits per second rate has to be 1411 kbps.
the (-1000) is the volume. 0 being max, I think, or then chili has put some restriction on the volume...
PS to see the info of the music file, right click on it and press properties at the bottom of the popup menu, the click the last tab of the properties menu.
the (-1000) is the volume. 0 being max, I think, or then chili has put some restriction on the volume...
PS to see the info of the music file, right click on it and press properties at the bottom of the popup menu, the click the last tab of the properties menu.
ʕ •ᴥ•ʔ
- accucore12
- Posts: 14
- Joined: May 18th, 2012, 1:06 pm
Re: Sound Playing error
Is there a way to change the code to suit my 705kbps .wav file?
It seems abit restrictive if we can only use a certain type.
It seems abit restrictive if we can only use a certain type.
Code: Select all
Occupation: Reverse Engineer
Re: Sound Playing error
Use online converters, google is your good ol' friend
Personally I use Freestudio's audio converter, but that will f up the music file, so you cant use it on chili's framework. A quick conversion on another converter fixed it up, tho.
Personally I use Freestudio's audio converter, but that will f up the music file, so you cant use it on chili's framework. A quick conversion on another converter fixed it up, tho.
ʕ •ᴥ•ʔ
- accucore12
- Posts: 14
- Joined: May 18th, 2012, 1:06 pm
Re: Sound Playing error
Yeah converting the sound file to the form required would be a fix.Thanks for the info.
I would like to know if it is possible to change the code so that the sound file work as well.This would aid in deepening my understanding of the setup of the code.Anyone knows how?
I would like to know if it is possible to change the code so that the sound file work as well.This would aid in deepening my understanding of the setup of the code.Anyone knows how?
Code: Select all
Occupation: Reverse Engineer
Re: Sound Playing error
Master chili knows.
You could try to mess around with the numbers is "music", just remember to make a backup of it. Usually messing around will teach you new stuff when your like "aha, so this changes that, but not those things".
You could try to mess around with the numbers is "music", just remember to make a backup of it. Usually messing around will teach you new stuff when your like "aha, so this changes that, but not those things".
ʕ •ᴥ•ʔ
Re: Sound Playing error
Try switching from 2 to 1 channel. (All you have to do is swap a few numbers)
Re: Sound Playing error
Damn it, that can't be right. Didn't notice the picture with the error. It must be the sample rate that's different. I guess you could set some breakpoints around to find out what the actual values are.
Re: Sound Playing error
Yeah, you can modify sound.cpp to make it load and play .wav files of different formats. You'll have to do a bit of research first though I guess, but it shouldn't be that difficult.
Chili