Class Alsa.Player
java.lang.Object
net.avadeaux.klipspringer.alsa.Alsa
net.avadeaux.klipspringer.alsa.Alsa.Player
- All Implemented Interfaces:
Closeable,AutoCloseable,Device.Player,PcmWriter
- Enclosing class:
Alsa
Class for sending PCM data to an ALSA device.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.avadeaux.klipspringer.alsa.Alsa
Alsa.Player, Alsa.TunerNested classes/interfaces inherited from interface net.avadeaux.klipspringer.codec.Device.Player
Device.Player.Factory -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets an estimate of how many frames are currently buffered, waiting to be played.booleanwrite(ByteBuffer data) Writes a block of audio data inthe bit layout expectedby the player.Methods inherited from class net.avadeaux.klipspringer.alsa.Alsa
canPause, close, drain, format, layout, pause, unpauseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
devices
-
-
Constructor Details
-
Player
public Player(Device device, PcmFormat format, double bufferSecs, int recoveryAttempts) throws IOException Creates a player to output PCM to the given device in the given format, specifying the size of the external buffer, and the number of recovery attempts in case of buffer underrun. Available devices are obtained throughdevices. A reasonable number of recovery attempts is 2, unless you want to set it to 0 and get an exception as soon as an underrun happens.- Throws:
IOException
-
-
Method Details
-
write
Description copied from interface:Device.PlayerWrites a block of audio data inthe bit layout expectedby the player. For most players, it makes sense to always return true, since players do not usually have a limit on the stream.- Specified by:
writein interfaceDevice.Player- Specified by:
writein interfacePcmWriter- Throws:
IOException
-
bufferedFrames
Description copied from interface:Device.PlayerGets an estimate of how many frames are currently buffered, waiting to be played. Default returns zero.- Specified by:
bufferedFramesin interfaceDevice.Player- Throws:
IOException
-