Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS如何将音频流传输至蓝牙扬声器_Ios_Iphone_Audio_Bluetooth_Microphone - Fatal编程技术网

iOS如何将音频流传输至蓝牙扬声器

iOS如何将音频流传输至蓝牙扬声器,ios,iphone,audio,bluetooth,microphone,Ios,Iphone,Audio,Bluetooth,Microphone,我想用我的iPhone4(iOS 7)将我的声音传输到一个延迟/延迟尽可能低的网络 我设法在几乎没有延迟的情况下捕获了我的语音,并通过音频插孔接口将其广播到扬声器,但当我将Iphone与蓝牙扬声器设备配对时,它无法工作。我什么也没听到 当我在iPhone中打开Youtube时,声音会正确地传输到蓝牙扬声器设备。所以问题不在于蓝牙扬声器设备,而在于我的代码 你有什么建议或建议吗 下面是我放在delegate类(didFinishLaunchingWithOptions函数)中初始化音频会话的代码:

我想用我的iPhone4(iOS 7)将我的声音传输到一个延迟/延迟尽可能低的网络

我设法在几乎没有延迟的情况下捕获了我的语音,并通过音频插孔接口将其广播到扬声器,但当我将Iphone与蓝牙扬声器设备配对时,它无法工作。我什么也没听到

当我在iPhone中打开Youtube时,声音会正确地传输到蓝牙扬声器设备。所以问题不在于蓝牙扬声器设备,而在于我的代码

你有什么建议或建议吗

下面是我放在delegate类(didFinishLaunchingWithOptions函数)中初始化音频会话的代码:

// configure the audio session
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *err = NULL;

// deactivate session
[audioSession setActive:NO error:&err];
if (err) {
    NSLog(@"There was an error deactivating the audio session");
}

[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:&err];
if( err ){
    NSLog(@"There was an error creating the audio session");
}

[audioSession overrideOutputAudioPort:AVAudioSessionPortOverrideNone error:&err];
if( err ){
    NSLog(@"There was an error sending the audio to the speakers");
}

// Activate the session
[audioSession setActive:YES error:&err];
然后我使用EZAudio框架将音频发送到音频设备:

/**
 Start the output
 */
[EZOutput sharedOutput].outputDataSource = self;
[[EZOutput sharedOutput] startPlayback];

你在这方面有进展吗?我也有同样的问题。我可以将我的声音以流的方式传输到其他任何输出,但不包括一个可调的扬声器。