Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Silence when playing ogg files

Aperta
#927 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start by reproducing the report: the snippet calls rodio::Decoder::try_from on an attached .ogg file and plays it through rodio::Player::connect_new(handle.mixer()), but the output is silent. Narrow down whether the decoder yields samples at all or the mixer drops them, and check the ogg file itself, which is attached as foo.txt and must be renamed back. Done means the basic example audibly plays an ogg file on the default device.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The basic example fails. The version is 0.22.2

fn main() {
    use rodio::Decoder;
    use std::fs::File;

    // Get an OS-Sink handle to the default physical sound device.
    // Note that the playback stops when the handle is dropped.//!
    let handle = rodio::DeviceSinkBuilder::open_default_sink().expect("open default audio stream");
    let player = rodio::Player::connect_new(handle.mixer());
    // Load a sound from a file, using a path relative to Cargo.toml
    let file = File::open("foo.ogg").unwrap();
    // Decode that sound file into a source
    let source = Decoder::try_from(file).unwrap();
    // Play the sound directly on the device
    handle.mixer().add(source);

    // The sound plays in a separate audio thread,
    // so we need to keep the main thread alive while it's playing.
    std::thread::sleep(std::time::Duration::from_secs(5));
}

Here is the ogg file in question (renamed as txt so that i can upload it on github)

foo.txt

Lingua principale
Rust
Stelle
2.5k
Fork
338
Merge medio
1g 3h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RustAudio/rodio

Tutte le issue di RustAudio/rodio

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.