audiotoolbox

Need to access the default camera shutter sound used by the iPhone

核能气质少年 提交于 2019-11-30 17:26:06
Right now when a user presses a button I play a custom camera shutter sound. However, if possible, I would much rather just use the camera shutter sound that plays by default whenever you take a photo using your iPhone. Is there a way that I can access and use the default iPhone camera shutter sound? And if yes, then where is it actually located? I need to figure out it's file path so that I can use it with the code below and just change the input for pathForResource : NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"shutter" ofType: @"wav"]; NSURL *fileURL = [[NSURL alloc]

ios pjsip - play a sound during sip call

让人想犯罪 __ 提交于 2019-11-30 07:51:52
问题 When I am on sip call, sometimes I want to send dtmf digits. To do this I created a custom dial pad which when a key is pressed should play a sound of that key, but it is not playing that sound during a sip call (when there is no call, sound is played). These sounds are played with functions from AudioToolbox.h library ( AudioServicesPlaySystemSound(soundID) ). Is there some property that I need to set up in pjsip (pjsua) or in AudioToolbox library to enable a sound be played during a sip

Need to access the default camera shutter sound used by the iPhone

可紊 提交于 2019-11-30 01:11:49
问题 Right now when a user presses a button I play a custom camera shutter sound. However, if possible, I would much rather just use the camera shutter sound that plays by default whenever you take a photo using your iPhone. Is there a way that I can access and use the default iPhone camera shutter sound? And if yes, then where is it actually located? I need to figure out it's file path so that I can use it with the code below and just change the input for pathForResource : NSString *soundFilePath

ios pjsip - play a sound during sip call

試著忘記壹切 提交于 2019-11-29 05:22:17
When I am on sip call, sometimes I want to send dtmf digits. To do this I created a custom dial pad which when a key is pressed should play a sound of that key, but it is not playing that sound during a sip call (when there is no call, sound is played). These sounds are played with functions from AudioToolbox.h library ( AudioServicesPlaySystemSound(soundID) ). Is there some property that I need to set up in pjsip (pjsua) or in AudioToolbox library to enable a sound be played during a sip call? I know this is possible ( Bria has this, Groundwire also, not sure if they are using pjsip to

Audio Processing: Playing with volume level

ⅰ亾dé卋堺 提交于 2019-11-29 01:42:26
问题 I want to read a sound file from application bundle, copy it, play with its maximum volume level(Gain value or peak power, I'm not sure about the technical name of it), and then write it as another file to the bundle again. I did the copying and writing part. Resulting file is identical to input file. I use AudioFileReadBytes() and AudioFileWriteBytes() functions of AudioFile services in AudioToolbox framework to do that. So, I have the input file's bytes and also its audio data format(via

Is there an event for when the headphones are unplugged?

爷,独闯天下 提交于 2019-11-28 23:21:20
During a test, a client noticed that video playback in the iPhone pauses when headphones are unplugged. He wanted similar functionality for audio playback, and maybe the ability to pop up a message. Does anyone know if there's an event of some kind I could hook into to make this possible? henklein See Responding to Route Changes from the Audio Session Programming Guide. -marc This changed with iOS 7, you just need to listen to the notification named AVAudioSessionRouteChangeNotification [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(audioRouteChanged:) name

Play audio through upper (phone call) speaker

。_饼干妹妹 提交于 2019-11-27 01:41:23
问题 I'm trying to get audio in my app to play through the upper speaker on the iPhone, the one you press to your ear during a phone call. I know it's possible, because I've played a game from the App Store ("The Heist" by "tap tap tap") that simulates phone calls and does exactly that. I've done a lot of research online, but I'm having a surprisingly hard time finding ANYONE who has even discussed the possibility. The overwhelming majority of posts seem to be about the handsfree speaker vs

Using AudioToolbox from Swift to access OS X master volume

﹥>﹥吖頭↗ 提交于 2019-11-26 20:44:31
问题 Is there a solution to setting the system's master volume from within my Swift app? I read a lot about AudioToolbox and read some source examples in Objective-C. For example, I found this: Setting Mac OS X Volume Programatically after 10.6 But I can't get it working in Swift. I am missing some example code in https://developer.apple.com/library/mac/documentation/AudioToolbox/Reference/AudioHardwareServicesReference/index.html#//apple_ref/c/func/AudioHardwareServiceGetPropertyData 回答1: (Code