scone icon indicating copy to clipboard operation
scone copied to clipboard

Audio

Open vladdeSV opened this issue 6 years ago • 3 comments

Allow playing sound files. Ideally some sort of sound handling system as well.

The user should be able to

  • play a sound
  • stop a sound

vladdeSV avatar Jun 01 '18 16:06 vladdeSV

I have no experience with audio systems, but here is how I imagine it would function.

  1. The user registers an audio file void register(size_t id, string filePath), and uses it as audio.register(42, "./audio/my-file.flac");
  2. The user plays the audio file by providing the id, and also gets some sort of audio handle. auto handle = audio.play(42);.
  3. The user can stop the audio with audio.stop(handle), and the handle is invalidated.

P.S. Maybe the file path should be some cross-platform variant, where you can provide one path which will work for both Windows and POSIX.

vladdeSV avatar Nov 09 '20 15:11 vladdeSV

Some other features which would be great, but not necessary would be

  • setting the volume of specific audio
  • fading the volume
  • looping the audio
  • pausing the audio

vladdeSV avatar Nov 09 '20 15:11 vladdeSV

The user registers an audio file void register(size_t id, string filePath)

I wonder if it should be up to the user or scone to give a sound file an id. Personally I feel like it should be up to scone to do so, but I think it would be much easier if the user themselves set up the ids.

vladdeSV avatar Jan 17 '21 15:01 vladdeSV