Created
November 13, 2013 22:27
-
-
Save joelpryde/7457637 to your computer and use it in GitHub Desktop.
Changes to allow Cinder to do multi-channel QT audio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+void MovieBase::setAudioDevice(const std::string& audioDeviceName, float audioBalance) | |
+{ | |
+ // create a QT Audio Context and set it on a Movie | |
+ ::QTAudioContextRef audioContext; | |
+ ::CFStringRef deviceId = ::CFStringCreateWithCString( kCFAllocatorDefault, audioDeviceName.c_str(), kCFStringEncodingUTF8 ); | |
+ OSStatus status = ::QTAudioContextCreateForAudioDevice(kCFAllocatorDefault, deviceId, NULL, &audioContext); | |
+ if (status) | |
+ throw QuickTimePathInvalidExc(); | |
+ | |
+ if (NULL != audioContext) | |
+ status = SetMovieAudioContext(getObj()->mMovie, audioContext); | |
+ | |
+ status = SetMovieAudioBalance(getObj()->mMovie, audioBalance, 0); | |
+} | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! Gets the audio playback volume ranging from [0 - 1.0] | |
float getVolume() const; | |
+ //! Sets the audio device we should use for this movie's playback | |
+ void setAudioDevice(const std::string& audioDeviceName, float audioBalance = 0.0f); | |
+ | |
//! Sets up Fourier analysis on the movie using \a numBands distinct bands in a single (mono) channel. This data is only available during playback. | |
void setupMonoFft( uint32_t numBands ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment