From 0bbdc3c5344b631e039a67a0aff481746e1aded3 Mon Sep 17 00:00:00 2001 From: ap4y Date: Sat, 4 Apr 2015 17:13:09 -0700 Subject: [PATCH] Use constant 48khz sampling rate for all opus files. Previously used sampling rate of original stream, according to the docs should be always 48khz. updates #57 --- OrigamiEngine/Plugins/OpusFileDecoder.m | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/OrigamiEngine/Plugins/OpusFileDecoder.m b/OrigamiEngine/Plugins/OpusFileDecoder.m index accd46b..869560c 100644 --- a/OrigamiEngine/Plugins/OpusFileDecoder.m +++ b/OrigamiEngine/Plugins/OpusFileDecoder.m @@ -27,7 +27,6 @@ @interface OpusFileDecoder () { OggOpusFile *decoder; - float frequency; long totalFrames; } @@ -56,7 +55,7 @@ - (NSDictionary *)properties { return [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:2], @"channels", [NSNumber numberWithInt:16], @"bitsPerSample", - [NSNumber numberWithFloat:frequency], @"sampleRate", + [NSNumber numberWithFloat:48000], @"sampleRate", [NSNumber numberWithDouble:totalFrames], @"totalFrames", [NSNumber numberWithBool:[source seekable]], @"seekable", @"little", @"endian", @@ -91,9 +90,6 @@ - (BOOL)open:(id)s { decoder = op_open_callbacks(source, &callbacks, NULL, 0, &rc); if (rc != 0) return NO; - - const OpusHead *head = op_head(decoder, -1); - if (head) frequency = head->input_sample_rate; totalFrames = (long)op_pcm_total(decoder, -1); [self parseMetadata];