Commit graph

37 commits

Author SHA1 Message Date
Noah Bennett
18911085a7
Add dynamic mixer example (#467)
This example plays a C Major 6th chord by adding four sources, sine waves frequencies of C, E, G, and A, to a `DynamicMixerController`, and appends its respective `DynamicMixer` to a sink.
2023-01-11 18:32:39 +01:00
dis-da-moe
268dddae64
Force queue to play sources on frame boundaries (#455)
As I understand it, this is the issue:
  
     * Previously, when a queue has `keep_alive_if_empty` set to true, and it becomes empty, then it will push a silence lasting 10ms onto the queue.
 
     * This is an issue because `current_frame_len` would have returned the worst case, `512`, and the silence lasts less than that.
 
     * This means that unless the source is added immediately to the queue, and so a silence is never played, then the first actual source could start playing at a frame that is not aligned to its channels, or play at the wrong sample rate.
 
     * This is only determined by when the source is added to the queue after its initialization. This explains why the issue was inconsistent, as it relied on the speed of execution of code which is basically random.

Solution
 
     * Change the functionality of `Zero` to add a method to create a silence with a certain number of frames.
 
     * Replace the 10ms silence with a silence the length of `THRESHOLD`
 
     * Change queue's `current_frame_len` to return `THRESHOLD` if a silence will be played next.
2022-11-23 01:36:57 +01:00
Alejandro Perea
69a7f416a7
Move sound to assets/; Exclude it from package (#421)
* Move sound to `assets/`; Exclude it from package

* Exclude tests from package
2022-03-26 20:15:18 +01:00
Austin Schey
0988e8c886
Add optional Symphonia backend (#376)
* add symphonia decoder

* add symphonia-flac

* better compile errors

* remove unsafe send

* update ci

* sudo

* disable duration check because symphonia does not support it

* add error handling

* cleanup

* update symphonia and fix breaking changes

* update to published symphonia version

* update docs

* reduce namespace duplication

* remove extra reference to current frame

* pr comments

* exclude decoders from module if unused

* fix flac test

* recommend disabling default features with symphonia
2021-06-29 09:12:28 +02:00
Alex Butler
7ca3b1d635
fix crossfade 2018 & cargo fmt 2020-05-02 13:34:11 +01:00
Alex Butler
d7c77aa52e
Add OutputStreamHandle 2020-05-02 13:33:57 +01:00
Alex Butler
560b232b9d
Make basic/beep example less ear-deadly 2020-05-02 13:33:57 +01:00
Alex Butler
b5071c947d
Remove device mixer map, rename stream wrapper to OutputStream 2020-05-02 13:33:57 +01:00
Alex Butler
c93adb2582
Migrate to edition 2018
* Remove unstable/legacy rustfmt config
* Run rustfmt
2020-05-02 13:33:57 +01:00
Alex Butler
0517ee7216
Add RodioDevice wrapper for cpal::Device
* Remove static/global facilities.
2020-05-02 13:33:56 +01:00
Alex Butler
4bb832ba30 Remove exclusive borrow requirement in Sink, SpatialSink (#203)
The inner Mutex does not require this.
2018-11-16 11:18:07 +01:00
Erin Moon
05fbda87db examples: add music_mp3 example 2018-05-26 18:42:22 -05:00
Francesco Zardi
6a8c71bdb2 Run cargo fmt 2018-04-19 10:03:48 +02:00
Francesco Zardi
95703113ba Rename 'endpoint' to 'device' 2018-04-19 08:59:27 +02:00
Francesco Zardi
cde47ab970 Rename default_endpoint() to, default_output_device(), reexport default_input_device() 2018-04-19 08:59:27 +02:00
Cam Jackson
8eaba65b5d Replace usages of deprecated functions in cpal 2017-10-11 21:31:15 +08:00
Pierre Krieger
88b0d40e4b Run rustfmt on the code 2017-07-03 10:10:00 +02:00
Jacob Kiesel
b4ecdfd075 Add spatial audio 2017-07-02 10:48:32 -06:00
Pierre Krieger
44a8a2b923 Rustfmt 2017-05-04 13:51:33 +02:00
tomaka
177cb7cbb8 Merge pull request #92 from tomaka/reverb-example
Add a reverb example
2017-05-01 11:31:26 +02:00
Pierre Krieger
99419b64ec Implement decoding Flac 2017-02-09 11:54:25 +01:00
Pierre Krieger
a29ad630f2 Expand basic example with printlns 2017-02-07 12:33:18 +01:00
Pierre Krieger
14cdd05bae Add a reverb example 2017-02-01 11:05:24 +01:00
Pierre Krieger
1eae866da4 Fix most warnings 2016-10-04 16:36:11 +02:00
Pierre Krieger
069faf762d Add a DecoderError and publish 0.3 2015-10-22 16:45:33 +02:00
Pierre Krieger
ddc5bec344 Update the examples to use the new API 2015-10-16 16:37:48 +02:00
Pierre Krieger
21900968b5 Fix the beep example 2015-10-16 15:40:30 +02:00
Pierre Krieger
c20ff8aa99 Improve timing system again 2015-09-27 14:49:53 +02:00
Pierre Krieger
5c68d37055 Add Handle::sleep_until_end and rework decoder handling 2015-09-23 10:33:45 +02:00
Pierre Krieger
338114d93e Add set_volume to Handle 2015-09-11 13:49:07 +02:00
Pierre Krieger
e49d8e1b32 Add music_ogg example 2015-09-10 17:53:00 +02:00
Pierre Krieger
aa74d06bb7 Reenable vorbis 2015-09-10 17:52:02 +02:00
Pierre Krieger
1b5bbdbb50 Use a BufReader in the examples 2015-09-10 16:38:16 +02:00
Pierre Krieger
89abf72790 Update to cpal 0.2 2015-09-10 16:17:37 +02:00
Pierre Krieger
5a438bcdec Add support for vorbis decoding 2015-07-22 14:23:03 +02:00
Pierre Krieger
de741115fd Add Handle type 2015-07-22 13:27:53 +02:00
Pierre Krieger
824b4f0041 Initial commit 2015-07-22 12:14:11 +02:00