Comments (2)
There is no dedicated "no more packets" error since for some supported formats there is no practical distinction between an EOF condition and when we've read all the packets. For example: MP3, there is no actual defined duration and therefore nothing to check if we reached the end other than just failing to read more data from the file/source.
So this is expected behaviour. The descriptive text for the UnexpectedEof
should read "end of stream". If there is an actual problem with your files you will get some kind of DecodeError
with a detailed message as to what the issue is.
from symphonia.
umm, interesting.. I haven't known that mp3 might not have any sentinel or total record size.
However, this kind of EOF occurs everytime files are decoded and have to distinguished from other IO errors.
Probably this is the most strict check. Very complicated and still not clear if this is perfect.
let packet = match format.next_packet() {
Ok(packet_ok) => packet_ok,
Err(Error::IoError(ref packet_err))
if packet_err.kind() == std::io::ErrorKind::UnexpectedEof =>
{
println!("complete!");
break;
}
Err(packet_err) => panic!("{:?}", packet_err),
};
I prefer like this. I know adding enum item is incompatible change and not easy to do that. So it's just a suggestion.
let packet = match format.next_packet() {
Ok(packet_ok) => packet_ok,
Err(Error::EndOfStream)
{
println!("complete!");
break;
}
Err(packet_err) => panic!("{:?}", packet_err),
};
from symphonia.
Related Issues (20)
- Unable to open a 12 channel wav file HOT 1
- Should bwfxml metadata appear when getting metadata? HOT 1
- bug: ADTS timebase missing HOT 5
- Benchmarks: File Size and Duration Information
- `AudioBuffer::make_equivalent` behavior surprising HOT 1
- Panic with wav files HOT 4
- Panic with invalid file HOT 1
- :rotating_light: Help Wanted: Looking for co-maintainers HOT 3
- SeekError::OutOfRange when seeking to timestamp 0 HOT 1
- Issues decoding a PCM stream HOT 4
- How to convert to an i16 mono sample HOT 1
- Push interface for frame readers HOT 1
- time::Duration HOT 9
- Update cpal to current version in `symphonia-play` HOT 2
- Calculating audio track duration in seconds HOT 7
- Vorbis decoder panics with end of stream HOT 2
- Opus probe panics with `unsupported format: DecodeError("ogg: packet buffer would exceed max size")` HOT 1
- (Feature request) Video support on symphonia-play HOT 1
- Metadata Tags Write HOT 1
- Missing cover visuals in certain opus files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from symphonia.