Refactor
This commit is contained in:
parent
fa7fcfd960
commit
5346c19553
|
|
@ -247,9 +247,12 @@ typedef void(^STKFrameFilter)(UInt32 channelsPerFrame, UInt32 bytesPerFrame, UIn
|
|||
/// Disposes the STKAudioPlayer and frees up all resources before returning
|
||||
-(void) dispose;
|
||||
|
||||
//
|
||||
/// Sets playback speed
|
||||
-(void)setPlaybackSpeed:(double)speed;
|
||||
|
||||
/// Sets playback speed to 1.0
|
||||
-(void)setDefaultPlaybackSpeed;
|
||||
|
||||
/// The QueueItemId of the currently playing item
|
||||
-(NSObject*) currentlyPlayingQueueItemId;
|
||||
|
||||
|
|
|
|||
|
|
@ -375,7 +375,8 @@ static void AudioFileStreamPacketsProc(void* clientData, UInt32 numberBytes, UIn
|
|||
.componentManufacturer = kAudioUnitManufacturer_Apple
|
||||
};
|
||||
|
||||
playbackSpeedUnitDescription = (AudioComponentDescription) {
|
||||
playbackSpeedUnitDescription = (AudioComponentDescription)
|
||||
{
|
||||
.componentType = kAudioUnitType_FormatConverter,
|
||||
.componentSubType = kAudioUnitSubType_AUiPodTimeOther,
|
||||
.componentFlags = 0,
|
||||
|
|
@ -1924,10 +1925,16 @@ static void AudioFileStreamPacketsProc(void* clientData, UInt32 numberBytes, UIn
|
|||
[self stopThread];
|
||||
}
|
||||
|
||||
- (void)setPlaybackSpeed:(double)speed {
|
||||
-(void)setPlaybackSpeed:(double)speed
|
||||
{
|
||||
AudioUnitSetParameter(playbackSpeedUnit, kNewTimePitchParam_Rate, kAudioUnitScope_Global, 0, speed, 0);
|
||||
}
|
||||
|
||||
-(void)setDefaultPlaybackSpeed
|
||||
{
|
||||
[self setPlaybackSpeed:1.f];
|
||||
}
|
||||
|
||||
-(NSObject*) currentlyPlayingQueueItemId
|
||||
{
|
||||
OSSpinLockLock(¤tEntryReferencesLock);
|
||||
|
|
@ -2186,7 +2193,8 @@ static BOOL GetHardwareCodecClassDesc(UInt32 formatId, AudioClassDescription* cl
|
|||
CHECK_STATUS_AND_RETURN(AudioUnitSetProperty(outputUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, kOutputBus, &canonicalAudioStreamBasicDescription, sizeof(canonicalAudioStreamBasicDescription)));
|
||||
}
|
||||
|
||||
- (void)createPlaybackSpeedUnit {
|
||||
-(void) createPlaybackSpeedUnit
|
||||
{
|
||||
OSStatus status;
|
||||
|
||||
CHECK_STATUS_AND_RETURN(AUGraphAddNode(audioGraph, &playbackSpeedUnitDescription, &playbackSpeedNode));
|
||||
|
|
|
|||
Loading…
Reference in New Issue