B4A Library [B4X] Music Tracker Box (xm, s3m, mod)

Music player libraries for MOD, S3M and XM formats.
Support: B4A and B4J.

Demo b4a and b4j:


demob4a.png
demob4j.png


TrackerBox
  • Initialize
    Initialization
  • LoadModule (SampleRate As Int, Dir As String, FileName As String)
    Loading a module into memory
    SampleRate: 8000 Hz to 128000 Hz
  • ReadyModule As Boolean [read only]
    Module loaded into memory
  • I_NEAREST As Int [read only]
    Constant: No interpolation (value: 0)
  • I_LINEAR As Int [read only]
    Constant: Linear interpolation (value: 1)
  • I_SINC As Int [read only]
    Constant: Sinc interpolation (value: 2)
  • Interpolation As Int
    Set the resampling quality to one of I_NEAREST, I_LINEAR (default), I_SINC
    Return the current resampling quality setting.
  • MixBufferLength As Int [read only]
    Returns the length of the buffer required by Audio().
  • Audio (outputBuf() As Int) As Int
    Generate audio.
    The number of samples placed into outputBuf is returned.
    The output buffer length must be at least that returned by MixBufferLength().
    A "sample" is a pair of 16-bit integer amplitudes, one for each of the stereo channels.
  • SongName As String [read only]
    Return the name of the module
  • SequenceLength As Int [read only]
    Return the sequence length of the module
  • NumChannels As Int [read only]
    Return the number of channels of the module
  • SampleRatePlayback As Int
    Set the sampling rate of playback. This can be used with SampleRate to adjust the tempo and pitch.
    Return the sampling rate of playback.
  • Muted (channel As Int, mute As Boolean)
    Mute or unmute the specified channel. If channel is negative, mute or unmute all channels.
  • Row As Int [read only]
    Get the current row position.
  • NextRow As Int [read only]
    Get the next row position.
  • BreakSeqPos As Int [read only]
    Get the break sequence position.
  • SequencePos As Int
    Set the pattern in the sequence to play. The tempo is reset to the default.
    Get the current pattern position in the sequence.
  • CalculateSongDuration As Int [read only]
    Returns the song duration in samples at the current sampling rate.
  • Seek (samplePos As Int) As Int
    Seek to approximately the specified sample position.
    The actual sample position reached is returned.
  • SeekSequencePos (sequencePos As Int, sequenceRow As Int)
    Seek to the specified position and row in the sequence.
  • SequencerEnabled As Boolean
    Enable or disable the sequencer.
    Return true if the sequencer is enabled.
  • AudioOpen (SampleRate As Int)
    Opening a cross-platform* device for audio playback
  • AudioClose
    Closing a cross-platform* device for audio playback
  • AudioReady As Boolean [read only]
    State AudioWrite. True - busy
  • AudioWrite (Buf() As Byte, Offset As Int, Size As Int)
    Sample Playback (cross-platform*). Asynchronous function. Control with AudioReady
  • AudioWrite2 (Buf() As Byte, Offset As Int, Size As Int)
    Sample Playback (cross-platform*). Synchronous function
cross-platform*: For Android: android.media.AudioTrack, for PC: javax.sound.sampled.AudioSystem​

Liked? ;)
paypal-donate-button-png-clipart-png.79848

PayPal: [email protected]
Webmoney: Z247137597440
 

Attachments

  • TrackerBoxLib1_0.zip
    54.2 KB · Views: 170
  • DemoTB.zip
    127.1 KB · Views: 157

Lakhtin_V

Active Member
Licensed User
Longtime User
I see great potential in your library. She showed up just in time.
I want to solve a problem, finding a sound sample in a microphone signal. The signal sample is short, no more than 1-2 second. Will I be able to find such a sound in the signal from the microphone? Is it possible to solve this problem at the program level, by means of B4X. My task is to automatically listen to the sound at night at home and fix a given sample in it. For example, in my application I want to capture the sound of a door opening, it looks like a creak, but now my application reacts to any noise, wall clock strike, street noise, brother's snoring :). How can you automatically detect the reference sound in the background sound of the microphone. For me, I don't need to draw graphs of samples. I only need to compare samples. by string function type InString.
 

mazezone

Member
Licensed User
Longtime User
I see great potential in your library. She showed up just in time.
I want to solve a problem, finding a sound sample in a microphone signal. The signal sample is short, no more than 1-2 second. Will I be able to find such a sound in the signal from the microphone? Is it possible to solve this problem at the program level, by means of B4X. My task is to automatically listen to the sound at night at home and fix a given sample in it. For example, in my application I want to capture the sound of a door opening, it looks like a creak, but now my application reacts to any noise, wall clock strike, street noise, brother's snoring :). How can you automatically detect the reference sound in the background sound of the microphone. For me, I don't need to draw graphs of samples. I only need to compare samples. by string function type InString.

Read this: https://laplacian.wordpress.com/2009/01/10/how-shazam-works/
You can create snapshots of an audio sample using the Spectrum class (section FFT), or it's FFT.
And then compare them as described in the article above.
 
Top