We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code
pub fn parse_audio_file(file_handler: File) -> Result<(), Error> { let mss = MediaSourceStream::new(Box::new(file_handler), Default::default()); let probed = match symphonia::default::get_probe().format( &Default::default(), mss, &Default::default(), &Default::default(), ) { Ok(t) => t, Err(_) => { return Err(Error::Unsupported( "probe info not available/file not recognized", )) } }; let mut format = probed.format; let track = match format .tracks() .iter() .find(|t| t.codec_params.codec != CODEC_TYPE_NULL) { Some(k) => k, None => return Err(Error::Unsupported("not supported audio track")), }; let mut decoder = match symphonia::default::get_codecs().make(&track.codec_params, &Default::default()) { Ok(k) => k, Err(_) => return Err(Error::Unsupported("not supported codec")), }; loop { let packet = match format.next_packet() { Ok(packet) => packet, Err(Error::ResetRequired) => { return Err(Error::ResetRequired); } Err(err) => { if let IoError(ref er) = err { // Catch eof, not sure how to do it properly if er.kind() == io::ErrorKind::UnexpectedEof { return Ok(()); } } return Err(err); } }; decoder.decode(&packet)?; } }
file - compressed.zip
this file takes slowly entire available memory and crash app
similar problem with mp3 file - compressed.zip
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Code
file - compressed.zip
this file takes slowly entire available memory and crash app
similar problem with mp3 file - compressed.zip
The text was updated successfully, but these errors were encountered: