Commit graph

605 commits

Author SHA1 Message Date
dvdsk
745db82876
removes SeekableSource adds failable try_seek to Source 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
204a3f89c9
switch to fork for cpal 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
BOB450
eda5934a20
Replace minimp3 with minimp3_fixed witch fixes a vital security flaw (#504)
See https://rustsec.org/packages/slice-deque.html and #456
2023-07-26 00:21:03 +02:00
hinto-janai
9674ea56cf
queue: add crossbeam-channel feature flag (#500) 2023-05-25 10:25:00 +02:00
Benjins-automation
8f949a81c8
Upgrade plain-HTTP links to HTTPS in Cargo.toml files (#498)
Co-authored-by: Benji Smith <6193112+Benjins@users.noreply.github.com>
2023-05-21 08:02:32 +02:00
Starua
023ee21e21
Fix Sink skip apis (#494)
* Call `Sink::clear`/`Sink::skip_one` on an empty `Sink` will permanently skip any `Source` append to it
* Call `Sink::clear` on an non-empty `Sink` can't reset it's length().
2023-04-28 12:53:31 +02:00
Ando “Thor” Nando
65d4dd3bdc
fmt: ubuntu workflow fix (#495) 2023-04-28 12:41:36 +02:00
myyrakle
5e034a2908
fix: index out of bound (#487) 2023-04-02 05:23:56 +02:00
Zachary Churchill
3d1a5ac54c
add EmptyCallback source (#430)
Co-authored-by: est31 <est31@users.noreply.github.com>
2023-03-11 20:51:03 +01:00
Joe Clay
d5b9ae3467 Release 0.17.1 2023-02-25 20:45:30 +01:00
Joe Clay
4e123a6366 Disable Symphonia default features 2023-02-25 20:45:30 +01:00
ivakam
e9a85ec254
Implement clear() and skip_one() functionality (continuation of #287) (#442)
* Clear and Skip functionality added

Added a clear() and skip_one() method to the Sink impl

* Use one lock for clear

Return the length in the queue clear function so that we don't have to get a lock twice.

* Rework skip to mark all sources as skippable


---------

Co-authored-by: Nathan Abel <abel8706@kettering.edu>
Co-authored-by: Ivar Kamsvåg <ivaka037@student.liu.se>
Co-authored-by: est31 <est31@users.noreply.github.com>
2023-02-19 13:46:18 +01:00
est31
56360d789c
Release 0.17.0 (#480) 2023-02-17 22:42:40 +01:00
est31
7b65d2fdd9
Edition 2021 (#479) 2023-02-17 22:14:05 +01:00
Jayden Dumouchel
44b92d43e9
Fix Sink playback after stop (#464)
Addressing issues #462 and #315 and #171

Given how the sink's queue is drained on stop I made some modifications in sink.append(). I added a check to ensure the sink was flushed completely (not sure this is necessary? I think it is, to avoid race conditions) and to restart the sink on append (when stopped.)

I added a test demonstrating correctness, as well as performing some trials on my own.
2023-02-17 21:12:32 +01:00
François
0c0e086b6a
update cpal to 0.15 (#478) 2023-02-17 13:05:23 +01:00
Johannes Hackel
317ec569fe
Support ADPCM formats in WAV files (#469) 2023-01-25 10:32:46 +01: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
Vitaliy
8efccbbf39
Enable gapless playback (#454) 2022-11-19 14:00:18 +01:00
Sergey "Shnatsel" Davidoff
92142b1a0c
Default to pure-Rust Symphonia for MP3 decoding (#453)
* Default to symphonia-mp3 over minimp3

* Update documentation to state that MP3 is decoded by Symphonia
2022-11-12 05:08:36 +01:00
Ando “Thor” Nando
70c80462e6
Create an OutputStream from a Device and SupportedStreamConfig (#445)
* Create an OutputStream from a Device and SupportedStreamConfig

* Refactor `try_from_device` and add more doc comments
2022-10-06 02:43:17 +02:00
David
e7faaf7506
Release version 0.16.0 (#441)
* Bump version to 0.15.1

* Update CHANGELOG.md

* Update Cargo.toml

* Update CHANGELOG.md
2022-09-14 14:43:27 +02:00
harudagondi
61367c92df
Update cpal to 0.14 (#435) 2022-08-27 15:17:01 +02:00
Anatol Ulrich
55d957f8b4
always seek to start in mp3::is_mp3() (#424) 2022-04-03 11:14:19 +02: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
Dimitris Apostolou
0356d810c9
Fix typos (#417) 2022-02-19 17:30:56 +01:00
Gavyn Riebau
b56de697c1 Remove debug_assert which was triggering unnecessary panic
When playing an mp3 on Windows in debug mode, sometimes
self.next_frame() is not empty in SampleRateConverter, leading to a
panic

See issue: #229
2022-02-18 01:19:35 +01:00
François
bf586a60cd
remove the need for a source to be debug on a spatial sink (#415) 2022-02-18 01:18:46 +01:00
François
db71e24ebf
spatial: ignore NaNs when setting the volume of each ear (#416)
ignore NaNs when setting the volume of each ear. min will return its value if self is a NaN. Also adds a check with debug_assert to help with debugging.
2022-02-18 00:10:46 +01:00
Will
c5c896c477
Run linter. (#414) 2022-02-17 05:38:38 +01:00
est31
ed16867cdb
Update symphonia to 0.5 (#412) 2022-01-31 18:01:11 +01:00
r4nd0m1z3r
846c643cbe
Added High-pass filter. (#384) 2022-01-31 18:00:57 +01:00
est31
1fb86e656d Add () around expression
Fixes #353, closes #389
2022-01-25 06:37:41 +01:00
est31
3aba98639c Update README as symphonia can do vorbis now 2022-01-25 04:00:26 +01:00
est31
cb9e72f2d9 Don't enable vorbis stuff is symphonia-vorbis is enabled 2022-01-25 03:56:49 +01:00
est31
9436db8e2b Add symphonia-vorbis feature to use symphonia's vorbis support instead 2022-01-25 02:20:57 +01:00
Stephen Sherratt
9ba6836e37
Release 0.15.0 (#408)
* Update symphonia dep

* Release 0.15.0
2022-01-25 01:57:53 +01:00
David M
49cc465604
Change Sink playback speed (#398)
* Add speed to Sink Controls

* Add Sink::set_speed

* Add Sink::speed getter

* Add speed and set_speed for SpatialSink

* Fix whitespace from previous commit
2022-01-25 01:57:24 +01:00
Nick Mahoney
b4f4dacb82
Change SineWave::new() to take a float. (#399)
It was immediately casting it to a float anyway.
2022-01-22 23:43:50 +01:00
NyantasticUwU
1095119dbe
Add len() method to SpatialSink. (#394) 2022-01-22 23:16:38 +01:00
Stephen Sherratt
5dbf93b94f
Replace loop with while (#407) 2022-01-13 09:32:53 +01:00
Stephen Sherratt
806ecaa60a
Implement Drop for FrameData (#285)
The types `Frame` and `FrameData` are mutually recursive, and the
incidental linked lists that can be formed as a result can be long (at
least in the order of thousands of elements). As a result, when a frame
is deallocated, rust appears to recursively call `drop_in_place` down
the list, causing stack overflows for long lists.
2022-01-12 16:34:00 +01:00
Mario
2c171d6683
Try next packet after a decode error (Symphonia) (#403)
* Skip no more than 3 consecutive decode errors

* missing delimiter

* Corrections after build

* use const

* reorganize second loop

Co-authored-by: Rrogntudju <rrogntudju@example.com>
2021-11-29 23:18:21 +01:00
Orson Peters
68b0333642 Reduced 32-bit integer test file size. 2021-10-01 04:20:25 +02:00
Orson Peters
4ad05a73fb Added 32-bit signed int WAV decoding. Fixes #344. 2021-10-01 04:20:25 +02:00
Chris Patuzzo
d40551db78 Extract DynamicMixer::sum_current_sources()
I think this makes the next() function easier to understand. We can
write this more efficiently by reusing a Vec on the struct rather than
allocating each time and a mem::swap to avoid shifting elements in a Vec.
2021-07-23 11:51:47 +02:00