Silence when playing ogg files
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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)
- 主要语言
- Rust
- 星标
- 2.5k
- 派生
- 338
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RustAudio/rodio 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 1/5 1 小时以内 新手友好度 73/100
-
难度 3/5 1-2 天 新手友好度 62/100
-
WavDecoder::size_hint underflows (u32 wrap, ~4.29e9) after EOF, causes multi-GB Vec::collect() allocation可能已有人在做 @marin-m 于 3 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 45/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 72/100
mozilla-services/syncstorage-rs#2715 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 70/100
-
documentation
难度 1/5 1 小时以内 新手友好度 82/100
physicsdolphin/nv-uefi-unlocker#53 · 4 个 reaction ·
维护者通常 1 天内回复
-
area/desktop-shell
难度 2/5 1-3 小时 新手友好度 72/100
yantrikos/yantrik-os#1012 ·
维护者通常 1 天内回复