Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ported SoundBankPlayer to ARC #1

Closed
wants to merge 1 commit into from

Conversation

YoniTsafir
Copy link

The main thing here is that Buffer had a pointer to NSString, which is forbidden, so I used a cString instead.

@@ -148,13 +145,13 @@ static void interruptionListener(void* inClientData, UInt32 inInterruptionState)

- (void)registerAudioSessionCategory
{
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, I now see that this part slipped in for me in the commit and is unconnected to porting to ARC, but I think this is a better default because you want to be able to record as well.

@hollance
Copy link
Owner

Looks good, although for the time being I will leave the project non-ARC.

Note that the PlayAndRecord category tends to make the playback volume lower. Maybe that only happens when you actually start recording something, but if you're not recording then I'd keep the category at MediaPlayback.

This class was written to be a drop-in solution for apps that just want to play audio. If you want to do more than that, then it's actually inappropriate for SoundBankPlayer to mess with the audio session.

@YoniTsafir
Copy link
Author

fair enough.
Anyhow - even if you plan to leave the project non-ARC, it might be a good idea to make it "ARC-ready" - meaning - easily convertable using the Xcode ARC conversion wizard.

For this - you only need to change the type of filename to be a char const * instead of an NSString * like I did, but you can leave the release and dealloc calls, etc.

@hollance
Copy link
Owner

Moved to project to ARC. The latest non-ARC version can be found in the before-arc tag.

@hollance hollance closed this Jun 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants