Help us understand the problem. What is going on with this article?

AVAudioPlayerNodeで特定の箇所から再生

More than 3 years have passed since last update.

AudioEngineを使った音声再生をやっていて、
再生、停止とかはサンプルとかで色々わかったんだけど
スライダーで移動した際に特定の箇所から再生する方法がわからなかったんですが
最初はAVAudioPlayerNodeのリファレンス見てて
- playAtTime:
かなって思ったんですが、これも関係はありそうだったんですが、結局はpurpleblues/PBAudioPlayerに答えがありました。
てかAudioEngineベースでプレイヤー作る人はこの人のやつをカスタムすればいいと思います。

PBAudioPlayer.m
        // ↓ここが重要
        [_playerNode scheduleSegment:_currentAudioFile
                       startingFrame:time * _currentAudioFile.fileFormat.sampleRate
                          frameCount:_currentAudioFile.length - time * _currentAudioFile.fileFormat.sampleRate
                              atTime:nil
                   completionHandler:nil];

scheduleSegmentでした
確かに時間パラメータに入ってるし。。。。
これリファレンスだと説明書きがないし。
あとAppleのリファレンスって他の言語に比べてすごいわかりづらいと思うのは俺だけだろうか見ててさっぱりわからんし、サンプルも微妙なものが多いし、どうやって調べたらいいのか正直わからん!

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away