views:

296

answers:

2

Hi All, Is it possible with coreaudio to play a sound out of the left or right channel. For example I want to play one out of the left channel and one out of the right.

At the moment I'm successfully using the following code to play a sound out of both channels:

NSSound *mySound = [[NSSound alloc] initWithContentsOfFile:@"/media/bell.wav" byReference:YES]; [mySound play]

Also I can't seem to find a full list of filetypes supported by ' initWithContentsOfFile'.

Thanks in advance.

Chris

A: 

Okay found part of the answer, the following link lists the support filetypes or coreaudio: http://developer.apple.com/mac/library/documentation/MusicAudio/Conceptual/CoreAudioOverview/SupportedAudioConverterFormats/SupportedAudioConverterFormats.html#//apple%5Fref/doc/uid/TP40003577-CH7-SW1

Now just to work out how to pan the sound between left a right speakers.

A: 

At the low level, you can use a multichannel mixer in an audio unit graph, but I suspect that's much harder than you're ready to deal with right now.

32-bit QuickTime has MediaSetSoundBalance(), but I don't see an equivalent property for QTKit at the media or track level (could be wrong, though). This is on Mac and not iPhone, right?

If you own the sounds that you're going to play, could you just pan your source audio files all the way to one side or the other and just play those?

invalidname