java-stream-player | OGG VORBIS , FLAC , MONKEY 's AUDIO and SPEEX audio formats | Audio Utils library
kandi X-RAY | java-stream-player Summary
kandi X-RAY | java-stream-player Summary
Java Advanced Audio Controller Library (WAV, AU, AIFF, MP3, OGG VORBIS, FLAC, MONKEY's AUDIO and SPEEX audio formats )
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Seek to the specified position in the stream
- Inits a DateLine instance
- Skips bytes in the stream
- Determines the properties for the audio file
- Main loop
- Stops the data line and free resources
- Convert milliseconds to time format
- Update progress
- Resume the playback
- Calculate progress
- Gets position byte
- Set the pan value
- Create a new thread
java-stream-player Key Features
java-stream-player Examples and Code Snippets
Community Discussions
Trending Discussions on java-stream-player
QUESTION
I am trying to skip a negative number of bytes with
AudioInputStream
skip(long bytes)
method .
The problem is trying to (let's say a small number of bytes...) :
...ANSWER
Answered 2018-Aug-19 at 17:36AudioInputStream.skip
does not support negative arguments. If you read the Javadoc of InputStream.skip
it says (emphasis mine):
Skips over and discards n bytes of data from this input stream. The
skip
method may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly0
. This may result from any of a number of conditions; reaching end of file before n bytes have been skipped is only one possibility. The actual number of bytes skipped is returned. Ifn
is negative, theskip
method for classInputStream
always returns0
, and no bytes are skipped. Subclasses may handle the negative value differently.
It does mention that subclasses may change this behavior but the documentation of AudioInputStream
does not give any indication it does this.
Class (AudioInputStream
) javadoc:
An audio input stream is an input stream with a specified audio format and length. The length is expressed in sample frames, not bytes. Several methods are provided for reading a certain number of bytes from the stream, or an unspecified number of bytes. The audio input stream keeps track of the last byte that was read. You can skip over an arbitrary number of bytes to get to a later position for reading. An audio input stream may support marks. When you set a mark, the current position is remembered so that you can return to it later.
The
AudioSystem
class includes many methods that manipulateAudioInputStream
objects. For example, the methods let you:
- obtain an audio input stream from an external audio file, stream, or
URL
- write an external file from an audio input stream
- convert an audio input stream to a different audio format
AudioInputStream.skip
javadoc:
Skips over and discards a specified number of bytes from this audio input stream.
This method will always skip an integral number of frames. If
n
does not specify an integral number of frames, a maximum ofn - (n % frameSize)
bytes will be skipped.
Also, if you look at the implementation of AudioInputStream.skip
you can see that the second if
statement immediately returns 0
if n
is <= 0
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install java-stream-player
You can use java-stream-player like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the java-stream-player component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page