Skip to content
This repository has been archived by the owner on Aug 7, 2019. It is now read-only.

Commit

Permalink
Use constant 48khz sampling rate for all opus files.
Browse files Browse the repository at this point in the history
Previously used sampling rate of original stream, according to the docs
should be always 48khz.

updates #57
  • Loading branch information
ap4y authored and ap4y committed Apr 5, 2015
1 parent 6a87833 commit 0bbdc3c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions OrigamiEngine/Plugins/OpusFileDecoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
@interface OpusFileDecoder () {
OggOpusFile *decoder;

float frequency;
long totalFrames;
}

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -91,9 +90,6 @@ - (BOOL)open:(id<ORGMSource>)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];
Expand Down

0 comments on commit 0bbdc3c

Please sign in to comment.