Questions tagged [rodio]

10 questions
2
votes
1 answer

How can I make Rust, with the Rodio crate, load multiple sources in a Vec, so I can play them later as needed without having to load them every time?

I am using Rust with the Rodio crate and I wanted to make a Vec of loaded sources to use whenever they are needed, so that the program doesn't need to load it every time. I've made a SoundHandler class that contains an OutputStream, an…
Felipe
  • 23
  • 5
2
votes
1 answer

Playing audio from url in Rust

I have used rodio crate for playing audio from local file, by going through docs, but not able to figure out how to play audio using url.
Ritik
  • 45
  • 1
  • 5
1
vote
1 answer

Rust Rodio get a list of OutputDevices

I'm new to the rust and I've been playing around with the Rodio audio library. I can play an audio file on the default audio output device like this: use std::fs::File; use std::io::BufReader; use rodio::{OutputStream, Sink}; fn main() { let…
Mortie
  • 316
  • 1
  • 4
  • 13
1
vote
1 answer

How can I know when a Rodio source or sink is done?

I'm trying to play some sounds with rodio. I am creating a Source and putting it into a Sink, but how can I know when one or the other has stopped playing? For example, I want to move to the next song after the first. let device =…
Carlo
  • 2,103
  • 21
  • 29
0
votes
0 answers

Rust rodio Sink stops playing when the function scope changes

I am building a simple music player in Rust. For the actual audio playback I have decided to use the rodio crate, specifically the contained Sink. I built a Player struct which contains a Sink, the OutputStream and the OutputStreamHandle. I'm saving…
KfK
  • 1
0
votes
0 answers

Having issues with rodio crate, getting no audio output

I am trying to use rodio crate in my project for providing audio playback feature. I created this API so far, use rodio::{Decoder, OutputStream, OutputStreamHandle, PlayError, Sink, StreamError}; use std::{ fs::File, io::BufReader, …
apoorv569
  • 143
  • 1
  • 12
0
votes
1 answer

Why do Rodio's Sink types fail to play when used inside of a struct?

Been trying to create a struct to do some music operations and I found that if you have a struct with a rodio::sink as a field, it will not play music. Here is my code: use rodio::{OutputStream, Source, Sink, Decoder}; use std::fs::File; use…
0
votes
1 answer

Avoid dropping the variable when wrapped into a struct

I have a Rodio's Sink wrapper in HAudioSink. I also implement a try_new_from_haudio function that, in short, creates a Sink instance, wrap it in HAudioSink and already starts playing the first audio. In Sink's docs it states: "Dropping the Sink…
daniellga
  • 1,142
  • 6
  • 16
0
votes
0 answers

why cant rodio find my default output device?

I'm creating a Sink and an OutputStreamHandle in rodio like this, just like the example in the docs does it. let (_stream, stream_handle) = rodio::OutputStream::try_default().unwrap(); let sink =…
0
votes
1 answer

File not found using Rodio crate

I am trying to take input from the user in the form of a String and passing it as a path for Rodio to play the audio file. When I pass it a hard-coded path it seems to work just fine but when I type the same path in as input it will give me an…
Equinox
  • 120
  • 2
  • 8