Support for downloading different audio types? #56
nednoodlehead
started this conversation in
Ideas
Replies: 1 comment
-
Hey @nednoodlehead, thanks for the feedback and sorry for the late answer. If I'm not mistaken, You can however try to filter out the types of audio formats you don't like: let video: Video;
let audio_stream: &Stream = video
.streams()
.iter()
.filter(|stream| stream.includes_audio_track && !stream.includes_video_track) // Get only the audio only streams
.filter(|stream| stream.mime.subtype() == "mpeg") // Filter for MPEG streams (or whatever you're looking for)
.max_by_key(|stream| stream.bitrate) // Get the best quality stream of all remaining
.expect("No streams match the filters"); For converting audio streams of one type to another, you can always fall back to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be nice if we had support for downloading audio via
best_audio()
could have some option to return the video as awav
ormp3
version. Not sure if this is some limitation with the YouTube Api or not, but it would be really nice. And I believepytube
downloads asmp3
by default, so it must be possible.I have been trying to use the files with other rust audio libraries like
symphonia
and there is no support for theopus
codec. Which makes using symphonia and rustube in the same project sort of complicated.Beta Was this translation helpful? Give feedback.
All reactions