I’m new to this forum and I have a question:
Is it possible to get the SAMPLES of a stream (I don’t mean the FSOUND_SAMPLE, I mean the “real” samples, the numbers) ?
I know, I could make a StreamCallback or a DspCallback, but I wanna use these SAMPLES NON-realtime, just to calculate something with them !
I tried it this way…
short *stereobuffer = (short *)FSOUND_Stream_GetSample(stream);
// stream is my audio file, I opened the stream before !
for(i=0; i < length; i++)
vec[i]=(float)(stereobuffer[i2] / 32767.0f);
// this is the left channel: i2
…but it doesn’t really work, I get only some very strange sounds (which are also good, but not what I wanted 😀 )
Is there a way to get access to the “real” SAMPLES ?
Thanks in advance,
PS: I’m working on Linux, but it should be cross-plattform (apple-linux-win)!
- holzi asked 13 years ago
Okay, now i found something in the forum and tried it this way:
I initialized fmod with:
FSOUND_Init(44100, 32, 0);
Then I loaded the sample with:
sample = FSOUND_Sample_Load(FSOUND_FREE, “/home/holzi/blabla.wav”, FSOUND_MONO, 0, 0);
Then I tried to cast the sample to floats in a for loop (like in the previous code example), but it also didn’t work.
So I tried:
because it was mentioned somewhere in the list, but then I get only errors!
Thanks for any help
- holzi answered 13 years ago
I m searching for exactly the same thing.
I need to access to the RAW data of a FSOUND_STREAM * or FSOUND_SAMPLE *.
I didn’t find stg in the forum, where do u read it (the name of the post or stg)…
Or if anyone has got a good solution (without DSP, or any callback, need direct access). Plz 😀
Please login first to submit.