Skip to content

Commit

Permalink
expose Symphonia decoders as features except AAC
Browse files Browse the repository at this point in the history
AAC is not working yet

Fixes #1
  • Loading branch information
Be-ing authored and obsoleszenz committed Apr 17, 2022
1 parent 9e60a04 commit 811863e
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 46 deletions.
29 changes: 24 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,41 @@ exclude = [
[workspace]
members = [
"core",
"decode_wav",
"decode_symphonia",
"encode_wav",
"demos/player",
"demos/writer",
]

[features]
default = ["decode-wav-only", "encode-wav"]
decode-wav-only = ["creek-decode-wav"]
default = ["decode", "encode-wav"]
decode = [ "creek-decode-symphonia" ]
# Not yet working https://github.com/RustyDAW/creek/pull/6#issuecomment-988491582
#decode-aac = [ "creek-decode-symphonia/aac" ]
decode-flac = [ "creek-decode-symphonia/flac" ]
decode-mp3 = [ "creek-decode-symphonia/mp3" ]
decode-pcm = [ "creek-decode-symphonia/pcm" ]
# Not yet working https://github.com/RustyDAW/creek/pull/6#issuecomment-988491582
#decode-isomp4 = [ "creek-decode-symphonia/isomp4" ]
decode-ogg = [ "creek-decode-symphonia/ogg" ]
decode-vorbis = [ "creek-decode-symphonia/vorbis" ]
decode-wav = [ "creek-decode-symphonia/wav" ]
decode-open-source = []
decode-all = []
decode-all = [
#"decode-aac",
"decode-flac",
"decode-mp3",
"decode-pcm",
#"decode-isomp4",
"decode-ogg",
"decode-vorbis",
"decode-wav"
]
encode-wav = ["creek-encode-wav"]

[dependencies]
creek-core = { version = "0.1", path = "core" }
creek-decode-wav = { version = "0.1.0", path = "decode_wav", optional = true }
creek-decode-symphonia = { version = "0.1.0", path = "decode_symphonia", optional = true }
creek-encode-wav = { version = "0.1.0", path = "encode_wav", optional = true }

# Unoptimized builds result in prominent gaps of silence after cache misses in the demo player.
Expand Down
37 changes: 1 addition & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
[![Crates.io](https://img.shields.io/crates/v/creek.svg)](https://crates.io/crates/creek)
[![License](https://img.shields.io/crates/l/creek.svg)](https://github.com/RustyDAW/creek/blob/main/COPYRIGHT)

Realtime-safe disk streaming to/from audio files

This crate is currently incomplete. So far only uncompressed WAV files are functional.

Realtime-safe disk streaming to/from audio files using [Symphonia](https://github.com/pdeljanov/Symphonia) to support a variety of codecs. Refer to [Symphonia's documentation](https://docs.rs/symphonia/latest/symphonia/#support) for supported codecs. Symphonia's Cargo features are exposed with the prefix `decode-`, except `aac` and `isomp4` which creek does not work with yet. For example, to enable MP3 decoding in creek, enable the `decode-mp3` feature.

# How the Read Stream Works

Expand All @@ -28,38 +25,6 @@ This stream automatically spawns an "IO server" that handles the non-realtime sa

The write stream works how you would expect. Once a block is filled with data, it is sent to the IO server to be written. This block is also recycled back to the stream after writing is done.

# Format and Codec Support Roadmap

Default decoding of files is provided by the [`Symphonia`] crate. (So far only wav is verified to work).

In addition to the default decoders, you may define your own using the `Decoder` trait.

### Formats (Demux)

| Format | Status | Default |
|----------|------------------------------|---------|
| Wav | :heavy_check_mark: Compliant | Yes |
| ISO/MP4 | :x: | No |
| MKV/WebM | :x: | Yes |
| OGG | :x: | Yes |

### Codecs (Decode)

| Codec | Status | Default |
|------------------------------|------------------------------|---------|
| Wav | :heavy_check_mark: Compliant | Yes |
| AAC-LC | :x: | No |
| HE-AAC (AAC+, aacPlus) | :x: | No |
| HE-AACv2 (eAAC+, aacPlus v2) | :x: | No |
| FLAC | :x: | Yes |
| MP1 | :x: | No |
| MP2 | :x: | No |
| MP3 | :x: | No |
| Opus | :x: | Yes |
| PCM | :x: | Yes |
| Vorbis | :x: | Yes |
| WavPack | :x: | Yes |

### Codecs (Encode)
| Codec | Status | Default |
|------------------------------|-------------------------------------------------|---------|
Expand Down
16 changes: 13 additions & 3 deletions decode_wav/Cargo.toml → decode_symphonia/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "creek-decode-wav"
name = "creek-decode-symphonia"
version = "0.1.0"
authors = ["Billy Messenger <BillyDM@tutamail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
keywords = ["audio", "io", "disk", "stream"]
categories = ["multimedia::audio"]
description = "WAV file decoding for creek"
description = "Audio file decoding for creek"
documentation = "https://docs.rs/creek-decode-wav"
repository = "https://github.com/RustyDAW/creek"

Expand All @@ -15,4 +15,14 @@ repository = "https://github.com/RustyDAW/creek"

[dependencies]
creek-core = { version = "0.1", path = "../core" }
symphonia = { version = "0.4", default-features = false, features=["wav", "pcm"] }
symphonia = "0.4"

[features]
#aac = [ "symphonia/aac" ]
flac = [ "symphonia/flac" ]
mp3 = [ "symphonia/mp3" ]
pcm = [ "symphonia/pcm" ]
#isomp4 = [ "symphonia/isomp4" ]
ogg = [ "symphonia/ogg" ]
vorbis = [ "symphonia/vorbis" ]
wav = [ "symphonia/wav" ]
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub use creek_core::*;

#[cfg(feature = "decode-wav-only")]
pub use creek_decode_wav::*;
#[cfg(feature = "decode")]
pub use creek_decode_symphonia::*;

#[cfg(feature = "encode-wav")]
pub use creek_encode_wav::*;

0 comments on commit 811863e

Please sign in to comment.