Hi, I’m new to the forum, but I’ve been fmodding for 3.5 months now in C and porting to Rebol. I’ve come across a possible bug shown nicely by the code below. Can anyone confirm this as a bug, or point out anything I might have missed ?


Title: "Init Record Bug"
File: %main.c
Date: 28-Apr-2005
Author: "Anton Rolls"
Purpose: {Show a bug in FMOD 3.74, error on second record (init, record, close, init, record <-}
Notes: {
It looks like FSOUND_Close or FSOUND_Record_Stop doesn’t cleanup the recording
functionality fully.. ?

    I'm on WinXP, soundcard is &quot;Creative SB Live! Value&quot; with &quot;EMU10K1 audio processor&quot;.
    The output I get from this program is:

        FMOD 3.74
        Recording Attempt 0
        Output: Direct Sound  Driver: Primary Sound Driver
        Started recording OK
        Stopped recording OK
        Recording Attempt 1
        Output: Direct Sound  Driver: Primary Sound Driver
        FMOD Error 17, Recording not supported on this device.

    (I have written a program which *does* successfully make a recording to
    a sample, I just noticed I couldn't FSOUND_Close and Init again in between


include <stdio.h>

include <fmod.h> // http://www.fmod.org/

include <fmod_errors.h>

if defined(WIN32) || defined(_WIN64) || defined(WATCOMC)

#include &lt;windows.h&gt;
#include &lt;conio.h&gt;


#include &quot;../../api/inc/wincompat.h&quot;


void print_driver_info(){
char *output="";
switch (FSOUND_GetOutput())
case FSOUND_OUTPUT_NOSOUND: output="NoSound"; break;
case FSOUND_OUTPUT_WINMM: output="Windows Multimedia Waveout"; break;
case FSOUND_OUTPUT_DSOUND: output="Direct Sound"; break;
case FSOUND_OUTPUT_OSS: output="Open Sound System"; break;
case FSOUND_OUTPUT_ESD: output="Enlightment Sound Daemon"; break;
case FSOUND_OUTPUT_ALSA: output="ALSA"; break;
printf("Output: %s Driver: %s\n", output, FSOUND_GetDriverName(FSOUND_GetDriver()));

void print_last_FMOD_error(){
int fmod_err = 0;
fmod_err = FSOUND_GetError();
printf("FMOD Error %i, %s.\n", fmod_err, FMOD_ErrorString(fmod_err));

void record(){
FSOUND_SAMPLE *sample = FSOUND_Sample_Alloc(
FSOUND_UNMANAGED, 2 * 44100, // 2 seconds
FSOUND_NORMAL, 44100, 255, 128, 255

if (!sample){
    puts(&quot;Couldn't allocate sample.&quot;);

if (!FSOUND_Record_StartSample(sample, 0)){ // &lt;--- returns fail the 2nd time
puts(&quot;Started recording OK&quot;);

puts(&quot;Stopped recording OK&quot;);



int main(int argc, char *argv[])
printf("FMOD %.02f\n", FMOD_VERSION);

int i;
for (i=0; i&lt;2; i++){
    printf(&quot;-------------------\nRecording Attempt %d\n&quot;, i);
    FSOUND_Init(44100, 32, 0);
    record(); // &lt;----------------- bug happens here second time

puts(&quot;&quot;); system(&quot;PAUSE&quot;);
return 0;


  • You must to post comments

I had the same problem with recording with VB (my source [url=http://www.vbfrance.com/code.aspx?ID=22988:2t4quryb]here[/url:2t4quryb]). Maybe it is because using FSOUND_UNMANAGED the FSOUND_CLOSE function DO NOT close the recording sample, and so residual data are remaining. Use FSOUND_SAMPLE_FREE to close the recoding sample before closing fmod.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.