Commit graph

512 commits

Author SHA1 Message Date
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
Chris Patuzzo
437bcf4ce7 Fix sources sometimes playing in the wrong channels
For example, if a stereo source starts playing on an odd-numbered call
to DynamicMixer::next() then the output stream will play its first
sample in the right channel, its second in the left, etc. This is wrong.
The first sample should be played in the left channel.
2021-07-23 11:51:47 +02:00
Aaron Kofsky
2e08a7efa6
Check if the frame length is zero in SkipDuration. (#388)
If the source we are skipping runs out of data, it will return Some(0)
as the frame length. Before, this would cause an infinite loop because
we would skip zero samples forever. This commit fixes it by checking
explicitly if the frame length is zero and bailing out if it is.
2021-07-18 00:52:16 +02:00
Alphyr
ba78af2070
Fix WavDecoder::total_duration (#383) 2021-07-06 21:55:45 +02:00
Austin Schey
f6bb97e0d3
fix sample rate for symphonia decoder (#380) 2021-06-30 19:57:19 +02:00
Will Page
edc60950b6
Fix for #377 infinite recursion crash (#378)
Implementing the Display trait on a type, and calling self.to_string()
in its implementation results in infinite recursion.

The default implementation of ToString for sized types that implement
Display relies on the Display trait in its implementation.
Consequently, calling `self.to_string()` in the implementation of
Display leads to infinite recursion.

This failure has been directly observed on the DecoderError type, and
the fix here is to move the logic for rendering the error as text out of
`Error::description()` and into `impl Display`. As it stands, the
`Error` trait provides a default implementation for `description()`
based on the `Display` trait if provided, so this is a simple, clean
change.

The failure is presumed to exist for Mp4Type, as it follows a similar
pattern of invoking `self.to_string()` in the `Display` implementation.
The solution there is basically to reverse the logic for `from_str()`.
2021-06-30 17:05:41 +02: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
Alphyr
dfb4bd62b9
Remove Send bound from Decoder::new_* (#375) 2021-06-21 23:00:05 +02:00
Alex Butler
f6af938d8d
Release 0.14.0 (#368)
* Add 0.14 changes to changelog

* Release 0.14
2021-05-21 22:15:25 +02:00
est31
95813b8104
Merge pull request #365 from alexheretic/try-more-devices
OutputStream::try_default: Fallback to non-default devices
2021-05-03 02:15:47 +02:00
Alex Butler
8894392fd8
OutputStream::try_default fallback to non-default devices 2021-05-02 12:36:51 +01:00
est31
e2a3a0b81f
Merge pull request #350 from jiminycrick/fix-stream-panic
Better error handling for stream creation
2021-05-02 13:33:22 +02:00
James Melkonian
3b840675c8 cargo fmt 2021-04-03 20:19:56 -07:00
jiminycrick
3ad927886c Better error handling for stream creation 2021-04-03 17:45:23 -07:00
Linus Probert
a6f50364b0
Adds 'cpal' to re-exports (#352)
If a user wants some finer access to devices and hosts this will allow
that without having to add a separate dependency to cpal and risk having
a cersion conflict between the cpal dependency and the version of cpal
within rodio.
2021-03-29 12:17:28 +02:00
est31
9154133e1c set-env has been deprecated
Set RODIO_TMP using the new method
2021-03-29 09:26:54 +02:00
est31
6e1b212538 Enable auto-publishing via github actions
Bases on @Luni-4's CI code added to cpal
2021-03-29 09:20:48 +02:00
Marcel Märtens
c397a4d8d1
Fix a error when rodio just panics instead of propagate an error to the user (#362)
Update version to 0.13.1
2021-03-29 08:58:23 +02:00
Nathan Stocks
99e0c6b0bf
Improve documentation about getting default output stream to a device (#357)
* Improve documentation about getting default output stream to a device

* Use intra-doc links. Provide examples that can compile and run.

* Restore no_run

* More no_run
2021-03-09 07:46:51 +01:00
est31
6cd3522826
Merge pull request #359 from CleanCut/github-actions
Migrate from Travis to GitHub Actions
2021-03-09 07:45:51 +01:00
Nathan Stocks
cbb6f5a376 Migrate from Travis to GitHub Actions 2021-03-08 22:54:56 -07:00
Christopher Serr
181da2994b
Remove unnecessary 'static bound and cleanup (#356)
* Remove unnecessary 'static bound and cleanup

The decoder had an unnecessary 'static bound. Additionally I noticed
that there's a lot of (clippy) warnings, so I cleaned up the code a bit
as well. There's a few warnings left, but a few of those require
breaking changes.

* Address Review Comments
2021-03-06 18:46:52 +01:00
SnoozeTime
e1aea73ba0
add feature flag to enable wasm-bindgen (#342) 2020-12-09 13:49:36 +01:00
David Ackerman
73857e3d51
Update cpal with Android support (#336)
* Add cpal with Android support. Update CHANGELOG

* Bump version to 0.13.0

* Update CHANGELOG
2020-11-03 15:04:48 +01:00
est31
7d61d283cd
Merge pull request #335 from eloc3147/master
Fix for overflow on 32bit
2020-10-27 00:00:39 +01:00
Kinnon McAlister
3d4c8b768b
Fix for overflow on 32bit 2020-10-26 15:39:55 -07:00
est31
0df7d1cbe6
Merge pull request #328 from nbraud/resampler
SampleRateConverter: Improve testsuite documentation/comments
2020-10-09 05:23:15 +02:00
est31
7e09057a7e
Merge pull request #329 from Paoda/master
Implement Display and Error traits for PlayError
2020-10-09 05:22:23 +02:00
Rekai Musuka
5907affb44 Implement Display and Error traits for PlayError 2020-10-08 17:59:16 -05:00
nicoo
6de3737305
SampleRate::tests::multiply_rate: Update comment 2020-10-08 13:21:59 +02:00
nicoo
60e5450d2d
SampleRateConverter: Document the various tests 2020-10-08 13:21:49 +02:00
est31
566e979203
Merge pull request #325 from est31/release_0_12
Release 0.12.0
2020-10-05 01:45:18 +02:00
est31
f34939b1dc Release 0.12.0 2020-10-05 01:10:01 +02:00
est31
71bc464ff2 Use OR instead of / 2020-10-05 01:09:40 +02:00
est31
78453e4b7f Changelog for 0.12.0 2020-10-05 01:08:57 +02:00
est31
cae37e121f
Merge pull request #324 from nbraud/resampler
SampleRateConverter: Fix reliance on Vec internals (see #303)
2020-10-05 00:57:11 +02:00
est31
eaf90ee836
Merge pull request #322 from HalfVoxel/master
Limit frame length in UniformSourceIterator
2020-10-03 21:29:27 +02:00
Aron Granberg
984b86616d Limit frame length in UniformSourceIterator 2020-10-03 13:10:06 +02:00
est31
3bc614fc12
Merge pull request #320 from HalfVoxel/master
Fix crackling audio when using Sink
2020-10-03 11:30:02 +02:00
est31
20a8f69e6b
Merge pull request #309 from ely-uf/feature/source_skip_duration
Add SkipDuration source.
2020-10-02 22:34:49 +02:00
Aron Granberg
1c376e8790 Fix SourcesQueueOutput::current_frame_len using upper bound instead of lower bound 2020-10-02 17:23:30 +02:00
Aron Granberg
77031e7e08 Add missing size_hint for Done source 2020-10-02 17:15:34 +02:00
est31
758a39f2ba
Merge pull request #317 from vickles/typed-new-decoder
Add new_X format specific methods to Decoder
2020-10-01 19:18:33 +02:00
Nicolas Braud-Santoni
412a02ae85
SampleRateConverter: Check that resampling does not change duration
Reproduces the issue in #316
2020-10-01 17:44:28 +02:00