when a stream is playing from the internet (shoutcast) … i want to save it to disc… i have 2 problems
pushing a controlbutton conteining this procedure
rawwrite_dsp = FSOUND_DSP_Create(addressof DSP_RawWriteCallback, FSOUND_DSP_DEFAULTPRIORITY_USER, 0)
call FSOUND_DSP_SetActive(rawwrite_dsp, TRUE)
the stream becomes a rumor and it returns normal only if i push another controlbutton containig this
call FSOUND_DSP_SetActive(rawwrite_dsp, FALSE)
what happens ???
the dsp_rawwritecallback function is:
Public Function DSP_RawWriteCallback(ByVal originalbuffer As Long, ByVal newbuffer As Long, ByVal length As Long, ByVal param As Long) as long
”’ i suppose here i have tu write this
put#h , , newbuffer
in which way how do i have to open the file ??? binary, random, etc ????
in which way how do i retrieve the newbuffer data from the pointer ???
- Anonymous asked 12 years ago
If your’e outputing to raw format then it would be really easy to do this. You need to open the file in binary. Do it like this:
Open File For Binary Access Write Lock Read Write As #h
This will open the file and prevent it from being accessed by other programs. Then all you need to do is do what you wrote:
Put #h, , newbuffer
And at the end of your DSP callback you need to return the newbuffer into the dsp chain, so put this at the end:
DSP_RawWriteCallback = newbuffer
That should work fine. But it won’t be in Wav format.
Btw, this is Paranoid_Android, but Im too lazy to log in! hehe 😀
Please login first to submit.