I search in the forum for something like this, and unfortunately no result (but i perhaps make a bad search 😉
All i want is something like this :
Read all byte (or signed int, don’t know) and put them on the screen (for yet).
I found a post in where someone speak about Sound::GetData() and Sound::SeekData() but that’s all i’ve found…
So i need to obtain someting like this :
FSOUND_STREAM * this->sample= SOUND_Stream_Open(“SOUND4.WAV”, FSOUND_2D,0,0);
int size_sample = FSOUND_Stream_GetLength(sample);
for (int i = 0 ; i < size_sample ; ++)
sample->Sound::SeekData(i); /// ????
signed char Data = sample->Sound::readData(); /// ????
printf(“%d \n”, Data);
If someone can help me …
There’s probably something i misunderstand with Lock/Unlock, cause i cannot obtain any good result, but here’s my code (without the loop for the time …).
// This is a PCM signed 16 Bit MONO 44.1 Khz 705 Kbps WAV (said goldwave) file leasting 1.485 Seconds
if (time>sample_time) time=0;
this->sample = FSOUND_Sample_Load(FSOUND_FREE,”SOUND4.wav”,FSOUND_NORMAL,0,0); // SEEM OK
FSOUND_Sample_GetDefaults(sample, &srcFreq, &srcVol, &srcPan, &srcPri); // just for infos – SEEM OK
FSOUND_Sample_Lock(sample, time, destLen1, &srcPtr1, &srcPtr2, &srcLen1, &srcLen2); // RETURN SEEM OK ptr seem pointing somewhere valid
this->size_sample = FSOUND_Sample_GetLength(sample); // not sure cause say 65477 but the sound least 1.485 second (but not important for now)
signed int Value = *((signed int *)srcPtr1); // … There seem the problem, when i output the Value (to a sound call back for exemple …), I try to cast in many way, or to make it working more … but never i got someting that’s the sound i loaded; the only sounds i got is like TV without teledistribution (Krchhhhhhhhhhhhrchhhhh …. surely * problem)
FSOUND_Sample_Unlock(sample, srcPtr1, srcPtr2, srcLen1, srcLen2);
I hope it’s enough to understand for u, but i can give all informations u need to help me… Sorry for bothering u like this 😉
No Way !!! Doesn’t want to work, i’m probably making stg wrong but i don’t know what.
But, I take ur record.cpp example, and i remade SAVETOWAVE for a LOADTOWAVE that will fill a signed short [buffer];
then i simply take all my value … when i compare my value coming from ur lock fct-> bad values, when i read my buffer, it’s correct, so for now i ll continue to use my bad method till FmodEx if i understand what u said in the forum …
Hope u ll improve the way to play with RAW data 😉 (or make better documentation for the dumbs like me :D)
Please login first to submit.