Skip to content

Commit 6d9b6c9

Browse files
committed
upgrade guide: mention Decoder::new behavior for symphonia
1 parent 056d7cc commit 6d9b6c9

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

UPGRADE.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The following Rodio *0.20.1* code:
3434
let (_stream, handle) = rodio::OutputStream::try_default()?;
3535
let sink = rodio::Sink::try_new(&handle)?;
3636
```
37-
becomes this in Rodio *0.21.0*:
37+
Should be written like this in Rodio *0.21.0*:
3838
```rust
3939
let stream_handle = rodio::OutputStreamBuilder::open_default_stream()?;
4040
let sink = rodio::Sink::connect_new(stream_handle.mixer());
@@ -46,5 +46,18 @@ The `SpatialSink` changes mirror those in `Sink` described above.
4646
Replace `DynamicMixerController` with `Mixer` and `DynamicMixer` with `MixerSource`.
4747

4848
## Decoder
49-
`Decoder::new_mp4` no longer takes an `Mp4Type` as hint. You can remove the argument
49+
- `Decoder::new_mp4` no longer takes an `Mp4Type` as hint. You can remove the argument
50+
- Symphonia now longer assumes all sources are seek-able. Use
51+
`DecoderBuilder::with_seekable` or `try_from` on a `File` or `Bufreader`.
5052

53+
The following Rodio *0.20.1* code
54+
```rust
55+
let file = File::open("music.ogg")?;
56+
let reader = BufReader::new(file);
57+
let source = Decoder::new(reader);
58+
```
59+
Should be written like this in Rodio *0.21.0*:
60+
```rust
61+
let file = File::open("music.ogg")?;
62+
let source = Decoder::try_from(music.ogg)?;
63+
```

0 commit comments

Comments
 (0)