This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// extract RAW PCM | |
NSURL* url = [[NSBundle mainBundle] URLForResource:@"" withExtension:@"mp3"]; | |
AVAsset* asset = [AVAsset assetWithURL:url]; | |
NSError* err = nil; | |
AVAssetReader* reader = [[AVAssetReader alloc] initWithAsset:asset error:&err]; | |
if (!err) { | |
AVAssetReaderAudioMixOutput* output = [[AVAssetReaderAudioMixOutput alloc] | |
initWithAudioTracks:[asset tracksWithMediaType:AVMediaTypeAudio] | |
audioSettings:nil]; | |
[reader addOutput:output]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<meta http-equiv="Content-Script-Type" content="text/javascript" charset="utf-8"> | |
<title></title> | |
<style type="text/css"> | |
</style> | |
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-2.2.1.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableData* data = [NSMutableData data]; | |
char str[] = "foo"; | |
[data appendBytes:str length:sizeof(str)]; | |
NSLog(@"%s %s", [data bytes], str); // foo foo | |
str[0] = 0; | |
NSLog(@"%s %s", [data bytes], str); // foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <AudioToolbox/AudioToolbox.h> | |
/* | |
AudioUnit unit = AudioUnitCreate(kAudioUnitType_Output, kAudioUnitSubType_RemoteIO); | |
// set properties | |
AudioUnitInitialize(unit); | |
AudioOutputUnitStart(unit); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
NSDictionary* parseRIFF(NSString* path) | |
parse RIFF file | |
General output dictionary | |
{ | |
formType = { | |
chunkId = ... ; |
NewerOlder