Commit graph

64 commits

Author SHA1 Message Date
Petr Gladkikh
d1d5726ce0 Rename try_open_stream and try_default_stream 2024-11-21 21:43:24 +04:00
Petr Gladkikh
678df037cb Custom output stream config example 2024-11-21 21:00:57 +04:00
Petr Gladkikh
4101ae9087 Remove unwrap and expect from example code 2024-11-20 00:58:05 +04:00
Petr Gladkikh
6a6e94c88e Rename dynamic_mixer.rs 2024-11-15 21:08:54 +04:00
Petr Gladkikh
af92566321 Cleanup
Code reformatted.
Removed experimental code.
2024-11-14 23:03:59 +04:00
Petr Gladkikh
179d41a53e Reformat code 2024-11-14 03:08:50 +04:00
Petr Gladkikh
83c002500f Update doc examples 2024-11-10 20:23:18 +04:00
Petr Gladkikh
2ee0a3cb7a Merge remote-tracking branch 'rust-audio/master' into init-revamp 2024-11-10 15:29:22 +04:00
Petr Gladkikh
352c39987e Add example comments 2024-11-10 15:06:33 +04:00
Petr Gladkikh
cabdda74a2 Update tests and examples 2024-11-10 02:34:49 +04:00
Petr Gladkikh
5cfe61f929 Update a basic example 2024-11-10 00:10:36 +04:00
dvdsk
48408bcfa6
AGC: adds inner and inner_mut & uses those in example
This removes the use of AGC's experimental atomic bool controls in
favor of the already stable periodic_access method of control.

The disadvantage is that periodic_access is significantly more difficult
for most users to undestand. It requires understanding of how closures
work with ownership and threading primitives like Atomics & Arc.
2024-10-17 22:41:38 +02:00
UnknownSuperficialNight
ee980bc5cf Add automatic_gain_control to Cargo.toml examples 2024-10-06 16:14:49 +13:00
UnknownSuperficialNight
0b20274043 Add AGC example 2024-10-06 16:04:30 +13:00
Jamie Hardt
135024650e rustfmt 2024-09-30 22:02:46 -07:00
Jamie Hardt
8899e6709f Renamed TestWaveform to SignalGenerator 2024-09-30 21:45:30 -07:00
Jamie Hardt
44cb217d48 Code review changes 2024-09-29 16:45:29 -07:00
Jamie Hardt
5fa0188cc3 Added signal_generator.rs example 2024-09-29 16:15:41 -07:00
Petr Gladkikh
dd1edbb11d WIP, simplify output stream initialization 2024-09-24 01:01:10 +04:00
Jamie Hardt
0c2c1941d6 Made noise feature
Noise source and example guarded by it.
2024-08-19 17:39:25 -05:00
Jamie Hardt
84a008dd27 Added noise_generator example 2024-08-11 15:28:15 -07:00
dvdsk
7473837814
add test checking for #578 2024-05-23 13:10:37 +02:00
dvdsk
fb44f71dc9
Fixes seek example and various spell/grammar issues
Co-authored-by: naglis <827324+naglis@users.noreply.github.com>
2024-01-31 14:53:10 +01:00
dvdsk
202687b934
adds try_seek for sink and all sources 2023-10-13 15:44:43 +02:00
dvdsk
d47842fe57
remove seek trait from source mods, added it to symphonia decoder, renamed the trait to SeekableSource 2023-10-13 15:44:43 +02:00
dskleingeld
023e833b01
request pos now uses mutable self 2023-10-13 15:44:43 +02:00
dskleingeld
fafe4ba1af
seek implemented through SourceExt trait 2023-10-13 15:44:43 +02:00
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