0
0

First off – I’ve scoured the forums, and have already found many gems buried in several threads. It appears that the mods do a good job of working through each and every problem – which is good, because I have one for them ๐Ÿ˜‰

I have a very simple ‘playsound’ file that compiles, builds, links, and seemingly runs without error, however no sound is produced. I’ve experimented with specifying the output mode (auto-detect, coreaudio – tried them both) since I have a USB sound card. I’ve even detatched the sound card in case that was affecting anything. Now I am not sure if this is going to be a OS 10.4 problem, or an XCode problem, or an FMOD problem, but that is why I am posting.

Are there any known issues with any of these platforms? I have the newest FMOD for sure. I have read thru most of the topics with correctly installing the dylib file, and I am pretty sure that is not the issue here.
Anyway, thanks for any input.

========================

include <iostream>

include <stdio.h>

include <fmod.hpp>

int main (void) {

std::cout&lt;&lt;"Initializing....\n";
char const * filename="jaguar.wav";

// float volume = 0.5f;
FMOD_RESULT result; // make a var for error correction
FMOD::System *system; // make a system var
FMOD::Sound *sound; // make a sound var
FMOD::Channel *channel; // make a channel var for the sound to be played on

FMOD::System_Create(&amp;system);               // create the system

system-&gt;setOutput(FMOD_OUTPUTTYPE_AUTODETECT);       // have fmod figure out what the output device should be

result = system-&gt;init(32, FMOD_INIT_NORMAL, 0);  // initialize the system        

std::cout&lt;&lt;"Loading sound...\n";
system-&gt;createSound(filename, FMOD_DEFAULT, 0, &amp;sound);      // load the file into &amp;sound

// result = channel->setVolume(volume);

std::cout&lt;&lt;"Playing sound...\n";
system-&gt;playSound(FMOD_CHANNEL_FREE, sound, false, &amp;channel);        // unleash the beast!


sound-&gt;release();                            // close the sound file
system-&gt;close();                         // system shutdown
system-&gt;release();                           // good bye cruel world

return 0;

}

edit: changed subject of topic to reflect the true nature of the problem

  • You must to post comments
0
0

[quote="brett":3vo0gc4u]where is your delay or wait for keypress or anything before immediately exiting your program as you are ? :o[/quote:3vo0gc4u]

thank you very much for the suggestion and the quick reply time. as a developer, it is very much appreciated. :)

i added this line just after system->playSound

std::cout &lt;&lt;"Press [Enter] to end" &lt;&lt;std::endl;
std::cin.get();

This program will correctly WAVWRITE the file as it is supposed to sound if i set the output accordingly. and now using your suggestion, i’ve found that FMOD will correctly output to speakers when using COREAUDIO. but unfortunately, i think my problem lies in the usb soundcard. when i try to set the output to AUTODETECT and use my m-audio fasttrack usb audio interface, the speakers simply pop at the beginning of the audio file, and upon termination of the program. is this within the scope of your support? ๐Ÿ˜•

  • You must to post comments
0
0

ok – so that definitly pin points the problem

i ran several example programs.
if i run a program through coreaudio without my usb audio interface plugged-in, then it works as expected

if i run a program through core audio with my usb audio interface plugged-in, then i get no audio. same applies if i run with autodetect (which i assume uses whatever is set as default in the Audio/Midi Setup in System Preferences).

So basically coreaudio works if it is the only output device listed :roll:

  • You must to post comments
0
0

FMOD_OUTPUTTYPE_COREAUDIO and FMOD_OUTPUTTYPE_AUTODETECT are pretty much exactly the same. AUTODETECT will always choose COREAUDIO as the output mode. The output will go through whatever sound device is selected in System Preferences > Sound > Output.

Have you tried the recording example? That example enumerates and lists the soundcards on your system and allows you to select which device to use for output.

  • You must to post comments
0
0

hey you guys-
thanks again for your patience with this problem-

i tried the recording example as uyou suggested as well as the multiplesoundcard example, which also allows for soundcard toggling

still, in both cases, playback will work thru coreaudio when the usb audio interface is not plugged in

when it is plugged in, neither work (i wasn’t changing the setOutput at all this time either, just selecting from the program prompt)

when i attempt playback thru the audio interface, i just hear a pop from the speakers

  • You must to post comments
0
0

What type of USB sound card are you using?

I have found that on our machine, if you unplug the sound card, and then plug it back in again, it will not work properly untill you reboot the mac.

Also, have you tried setting the sound output device to the usb sound card in the System Preferences sound properties? I assume you’ve confirmed that the sound card is working properly in other applications that use core audio (ie itunes).

  • You must to post comments
0
0

M-Audio FastTrack USB audio interface

naturally i’ve confirmed that the audio interface outputs properly in other audio applications. when i switch the default output device in system preferences between coreaudio and the fastTrack, all audio applications (peak, logic, matlab, itunes) switch to the proper output device.

now i’ve also tried rebooting with and without the fastTrack plugged in, but with no differing outcome.

===========================
just to concisely reiterate the exact circumstances of the problem:

  • FMOD correctly writes the output to file regardless of the output device specified in sys prefs (as is expected)
  • when the FastTrack is not plugged in, FMOD correctly plays output thru coreaudio
  • when the FastTrack is plugged in, FMOD will not output thru coreaudio nor the FastTrack
  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.