是__cxa_throw安全忽略与核心音频? [英] is __cxa_throw safe to ignore with Core Audio?

查看:784
本文介绍了是__cxa_throw安全忽略与核心音频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类似问题已被问..但我想让它更具体的核心音频..因为我们中的一些可能已经注意到核心音频有很少的空间错误。



由于所述问题的回答解释,__cxa_throw是一个C ++ 未处理的异常,可以忽略(这个问题似乎是新的Xcode 4.5 .1 ..我从来没有见过它)



我们可以说核心音频相同吗?什么让我紧张的是,它与音频的格式化..这很多我的代码依赖:



我试图转换一个AAC文件

  //设置用于转换的PCM输出格式
streamer-> PCMoutputFormat.mSampleRate = 44100.0;
streamer-> PCMoutputFormat.mFormatID = kAudioFormatLinearPCM;
streamer-> PCMoutputFormat.mFormatFlags = kAudioFormatFlagsCanonical;
streamer-> PCMoutputFormat.mBytesPerPacket = 4;
streamer-> PCMoutputFormat.mFramesPerPacket = 1;
streamer-> PCMoutputFormat.mBytesPerFrame = 4;
streamer-> PCMoutputFormat.mChannelsPerFrame = 2;
streamer-> PCMoutputFormat.mBitsPerChannel = 16;

输入格式:

  mSampleRate = 44100 
mFormatID = 1633772320(AAC)
mFormatFlags = 0
mBytesPerPacket = 0
mFramesPerPacket = 1024
mBytesPerFrame = 0
mChannelsPerFrame = 2
mBitsPerChannel = 0

实例变量:



game.h

  @接口游戏:NSObject< GKSessionDelegate> 
{
AudioStreamer * streamer;
}

@property(nonatomic,assign)AudioStreamBasicDescription mediaItemInputFormat;

audioStreamer.h

  @interface AudioStreamer:NSObject 
{
@public
AudioStreamBasicDescription PCMoutputFormat;
AudioConverterRef audioConverter;
}

在game.m中设置转换器命令这是__cxa_throw未处理的异常抛出的地方!)

  //设置转换器
OSStatus result = AudioConverterNew ; _mediaItemInputFormat,
& streamer-> PCMoutputFormat,
& streamer-> audioConverter);


解决方案

如果例外没有最终终止应用程序然后一些其他代码片处理它。如果你信任任何代码,那么没有什么可担心的。


A similar question has been asked.. but I wanted to make it more specific to core audio.. as some of us may have noticed core audio has very little room for error.

As the answer to the said question explains, __cxa_throw is a C++ unhandled exception, which can be ignored (this problem seems to be new with Xcode 4.5.1.. I've never seen it before as well)

can we say the same about core audio? What makes me nervous is that it has to do with formatting of the audio.. which a lot of my code depends on:

I'm trying to convert an AAC file unto lPCM..

output format:

// set up the PCM output format for conversion
streamer->PCMoutputFormat.mSampleRate = 44100.0;
streamer->PCMoutputFormat.mFormatID = kAudioFormatLinearPCM;
streamer->PCMoutputFormat.mFormatFlags = kAudioFormatFlagsCanonical;
streamer->PCMoutputFormat.mBytesPerPacket = 4;
streamer->PCMoutputFormat.mFramesPerPacket = 1;
streamer->PCMoutputFormat.mBytesPerFrame = 4;
streamer->PCMoutputFormat.mChannelsPerFrame = 2;
streamer->PCMoutputFormat.mBitsPerChannel = 16;

input format:

mSampleRate = 44100
mFormatID = 1633772320 (AAC)
mFormatFlags = 0
mBytesPerPacket = 0 
mFramesPerPacket = 1024
mBytesPerFrame = 0
mChannelsPerFrame = 2
mBitsPerChannel = 0

instance variables:

game.h

@interface Game : NSObject <GKSessionDelegate>
{
    AudioStreamer *streamer;
}

@property (nonatomic, assign) AudioStreamBasicDescription mediaItemInputFormat;

audioStreamer.h

@interface AudioStreamer : NSObject
{
    @public
        AudioStreamBasicDescription PCMoutputFormat;
        AudioConverterRef audioConverter;
}

setting up converter command in game.m (this is where the __cxa_throw unhandled exception is thrown!)

// set up converter
OSStatus result = AudioConverterNew(&_mediaItemInputFormat,
                                    &streamer->PCMoutputFormat,
                                    &streamer->audioConverter);

解决方案

If the exception didn't end up terminating the application then some other piece of code handled it. If you trust whatever piece of code that was then there's nothing to worry about.

这篇关于是__cxa_throw安全忽略与核心音频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆