bartolsthoorn / NVDSP

iOS/OSX DSP for audio (with Novocaine)
MIT License
413 stars 80 forks source link

Feed it the next song... #39

Closed doriansgithub closed 6 years ago

doriansgithub commented 6 years ago

I also can't figure out how to feed it another song. It plays one song, then stops.

K-Be commented 6 years ago

Why you can't allocate other file reader for other song?

doriansgithub commented 6 years ago

I'm not sure. That same delegate "[self mediaDelegate nextSongPlay];, works with other players.

The song length reaches 0, but somehow the player won't play the next song in the array.

K-Be commented 6 years ago

What are "players"? Novocaine does not contain such class. Novocaine is a library, that works with data buffers, that should contain datas of a sound. You should implement a player by your self. If you want, you can use AudioFileReader (to read data from a file), if you don't want you can write your custom data source to get data for Novocaine (for example, from memory of from a midi generator).
If you want to play next sound, you should replace data reader with new data reader and put a new data into Novocaine's inputBlock.

doriansgithub commented 6 years ago

Our main player (singleton), is able to use different players like the AVAudioPlayer, or StreamingKit player as needed.

We use the file reader. The short code sample shows the file reader being called.

Ok, we will look into having the two readers.

Thanks.

Sent from my iPad

On Nov 23, 2017, at 6:02 PM, Andrew notifications@github.com wrote:

What are "players"? Novocaine does not contain such class. Novocaine is a library, that works with data buffers, that should contain datas of a sound. You should implement a player by your self. If you want, you can use AudioFileReader (to read data from a file), if you don't want you can write your custom data source to get data for Novocaine (for example, from memory of from a midi generator). If you want to play next sound, you should replace data reader with new data reader and put a new data into Novocaine's inputBlock.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

doriansgithub commented 6 years ago

Hi, do we know if this player can play “gapless”?

Thanks,

Dorian

On Nov 21, 2017, at 6:14 PM, Andrew notifications@github.com wrote:

Why you can't allocate other file reader for other song?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bartolsthoorn/NVDSP/issues/39#issuecomment-346222375, or mute the thread https://github.com/notifications/unsubscribe-auth/AFc2kMROwaLC2uq5PX55DW4H6WFk5XPCks5s44OOgaJpZM4QmuO9.

K-Be commented 6 years ago

If you give data “gapless”, Novocaine will play it “gapless”. Novocaine is not a player it does not have meaning of a song or play list. Novocaine just works with buffers of data. If you open AudioFileReader you will see that this class just reads data into supported format and sends it to the delegate.

doriansgithub commented 6 years ago

Ok, thank you.

Sent from my iPhone

On Jan 8, 2018, at 6:57 PM, Andrew notifications@github.com wrote:

If you give data “gapless”, Novocaine will play it “gapless”. Novocaine is not a player it does not have meaning of a song or play list. Novocaine just works with buffers of data. If you open AudioFileReader you will see that this class just reads data into supported format and sends it to the delegate.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

bartolsthoorn commented 6 years ago

I will close this as it seems like you found the answer! 😄