Re: kAudioDevicePropertyHogMode and NSSpeechSynthesizer...
Re: kAudioDevicePropertyHogMode and NSSpeechSynthesizer...
- Subject: Re: kAudioDevicePropertyHogMode and NSSpeechSynthesizer...
- From: "charlie" <email@hidden>
- Date: Fri, 04 Jun 2010 15:24:47 +0000
I know you have now moved away from this, for the moment at least,
but are you / were you autoreleasing your NSSound object
I noticed that in the documentation last night too. I had been
autoreleasing it, but changed it to release inside
sound:didFinishPlaying:. It didn't change/affect the problem
unfortunately.
Chuck
On June 4, 2010 10:23:02 A.M. EDT, Paul Sanders
<email@hidden> wrote:
I can hear the voice begin to speak for just a split second now, but
then it gets cut off in the middle of the first word of the
sentence. If I add a little NSThread sleep after I play the
NSSound, I can hear a little more. If I increase the sleep to a
long enough interval, I can hear the whole thing. My guess is that
it has to do with returning to the runloop.
I know you have now moved away from this, for the moment at least,
but are you / were you autoreleasing your NSSound object (or using
GC)? If so, I think your problem might be this (taken from the
overview section of the NSSound documentation):
"You should retain NSSound objects before initiating playback or make
sure you have a strong reference to them in a garbage-collected
environment. Upon deallocation, a sound object stops playback of the
sound (as needed) so that it can free up the corresponding audio
resources. If you want to deallocate a sound object immediately after
playback, assign a delegate and use the sound:didFinishPlaying:
method to deallocate it."
I suspect that what is happening is that your NSSound object is being
deallocated (or garbage collected) when you return to the runloop and
therefore stops playing at that point. Knowing that, a solution
should not be hard to find.
Regards,
Paul Sanders.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden