Skip to content

Commit

Permalink
release 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
changsanjiang committed Feb 9, 2023
1 parent 711dece commit 5fcc2b0
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 20 deletions.
8 changes: 4 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- SJAudioPlayer (1.0.3):
- SJAudioPlayer/Core (= 1.0.3)
- SJAudioPlayer/Core (1.0.3)
- SJAudioPlayer (1.0.4):
- SJAudioPlayer/Core (= 1.0.4)
- SJAudioPlayer/Core (1.0.4)

DEPENDENCIES:
- SJAudioPlayer (from `../`)
Expand All @@ -11,7 +11,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
SJAudioPlayer: 6c9edda87247f318769cdd869ec444651d80cb44
SJAudioPlayer: 923dbc71c3a4aa81e2b5b535c8a9c7db679e8a33

PODFILE CHECKSUM: 04ace31981e2163660b2b311309546932112e7d9

Expand Down
4 changes: 2 additions & 2 deletions Example/Pods/Local Podspecs/SJAudioPlayer.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Example/SJAudioPlayer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
77EF40D1262E802A00A985A1 /* 网易游戏 - 长寿村.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 77EF40D0262E802A00A985A1 /* 网易游戏 - 长寿村.mp3 */; };
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
89140F21B5BF792C68A94690 /* libPods-SJAudioPlayer_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 54ABA5E259837B9C90EF7C7A /* libPods-SJAudioPlayer_Tests.a */; };
A6A1D5A928AF2882009CDFDD /* 1.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = A6A1D5A828AF2882009CDFDD /* 1.mp3 */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -120,7 +119,6 @@
77EF40D0262E802A00A985A1 /* 网易游戏 - 长寿村.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "网易游戏 - 长寿村.mp3"; sourceTree = "<group>"; };
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
A458E1DB0F5A924DAA4692A3 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
A6A1D5A828AF2882009CDFDD /* 1.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 1.mp3; sourceTree = "<group>"; };
C5F4F3A367A6D5A00D051C10 /* SJAudioPlayer.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SJAudioPlayer.podspec; path = ../SJAudioPlayer.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -193,7 +191,6 @@
6003F5A5195388D20070C39A /* SJViewController.h */,
6003F5A6195388D20070C39A /* SJViewController.m */,
77EF40D0262E802A00A985A1 /* 网易游戏 - 长寿村.mp3 */,
A6A1D5A828AF2882009CDFDD /* 1.mp3 */,
77EF407B262DA10000A985A1 /* SJProgressView */,
71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */,
6003F5A8195388D20070C39A /* Images.xcassets */,
Expand Down Expand Up @@ -400,7 +397,6 @@
77EF40D1262E802A00A985A1 /* 网易游戏 - 长寿村.mp3 in Resources */,
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */,
A6A1D5A928AF2882009CDFDD /* 1.mp3 in Resources */,
6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
77EF40A2262DA10000A985A1 /* LICENSE in Resources */,
Expand Down
Binary file removed Example/SJAudioPlayer/1.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion Example/SJAudioPlayer/SJViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ - (IBAction)playOrPause:(UIButton *)sender {

- (IBAction)replace {
NSURL *URL = nil;
URL = [NSBundle.mainBundle URLForResource:@"1" withExtension:@"mp3"];
URL = [NSBundle.mainBundle URLForResource:@"网易游戏 - 长寿村" withExtension:@"mp3"];
[_player replaceAudioWithURL:URL];
[_player play];
}
Expand Down
2 changes: 1 addition & 1 deletion SJAudioPlayer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SJAudioPlayer'
s.version = '1.0.4'
s.version = '1.0.5'
s.summary = 'iOS MP3 Audio Player using AVAudioEngine.'

# This description is used to generate tags and improve search results.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ - (nullable AVAudioPCMBuffer *)convertPackets:(NSArray<id<APAudioContentPacket>>
}
}

AVAudioFrameCount nAllFrames = (AVAudioFrameCount)(_streamFormat.streamDescription->mFramesPerPacket * packets.count);
Float64 sampleRateScaleFactor = (Float64)_outputFormat.streamDescription->mSampleRate / _streamFormat.streamDescription->mSampleRate;
AVAudioFrameCount nAllFrames = (AVAudioFrameCount)(_streamFormat.streamDescription->mFramesPerPacket * packets.count * sampleRateScaleFactor);
UInt32 nAllPackets = (AVAudioPacketCount)(nAllFrames / _outputFormat.streamDescription->mFramesPerPacket);
AVAudioPCMBuffer *buffer = [AVAudioPCMBuffer.alloc initWithPCMFormat:_outputFormat frameCapacity:nAllFrames];
if ( buffer == nil ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ - (instancetype)initWithStreamFormat:(AVAudioFormat *)streamFormat {

- (nullable AVAudioPCMBuffer *)convertPackets:(NSArray<id<APAudioContentPacket>> *)packets error:(NSError **)error {
NSError *innerError = nil;
AVAudioFrameCount frameCapacity = (AVAudioFrameCount)(_streamFormat.streamDescription->mFramesPerPacket * packets.count);
Float64 sampleRateScaleFactor = (Float64)_outputFormat.streamDescription->mSampleRate / _streamFormat.streamDescription->mSampleRate;
AVAudioFrameCount frameCapacity = (AVAudioFrameCount)(_streamFormat.streamDescription->mFramesPerPacket * packets.count * sampleRateScaleFactor);
AVAudioPCMBuffer *outputBuffer = [AVAudioPCMBuffer.alloc initWithPCMFormat:_outputFormat frameCapacity:frameCapacity];
outputBuffer.frameLength = frameCapacity;
__weak typeof(self) _self = self;
Expand Down

0 comments on commit 5fcc2b0

Please sign in to comment.