Saturday, October 26, 2013

Feature List / Updates / Changes

NonTrivialAudio:



  •  Added method to retrieve raw data:

int[] channelRawData = instanceOfNonTrivialAudio.getAudioDataRaw(channel);

  • Added method to retrieve data from all channel at once.  

Double[][] allChannelNormData = instanceOfNonTrivialAudio.getAllChannelAudioNormData(); 

NOTE:
Retrieving data from all channels requires a relatively large heap space. Make sure to increase heap space before hand to avoid OutOfMemoryException 

  • Added method to retrieve data utilizing all the available CPU cores.  


 Double[] channelNormData = instanceOfNonTrivialAudio.getAudioNormData_multicore(channel,chunk_dur_secs); 

This is one of the major improvements that I've been working on since some time already. I finally managed to finish it off.  I am going to talk a lot about this on a separate blog post.


  • Added method to mute the audio. 


 instanceOfNonTrivialAudio.setMute(bool_state);

I received a suggestion from a user suggesting to add volume controls. I thought it would be a good addition to the existing framework. As a result, this method would mute the audio that currently is being played. 

I also wrote a method to explicitly adjust the volume via setVolumeLevel(norm_vol_level)but, its experimental. I will finalize it in the coming versions.
 

 AudioUI:

  • Now, the type of display needs to be specified before interacting with the display.

// Get the file 
audFile = new File("/path/to/file/someFile.wav");

// Channel to read 
myAudio.setChannelToRead(channel);

// Attach the file 
 myAudio.setAudioFile(audFile); 

 // Suggest the type of display desired -- MUST call!
 // Must be called after the intial UI setup myAudio.setContainerDisplay(AudioDisplay.TYPE.WAVEFORM); 

 // Setup the display

myAudio.getDisplay(AudioDisplay.TYPE.WAVEFORM).setTimePrecision(4);
myAudio.getDisplay(AudioDisplay.TYPE.WAVEFORM).setZoomLevel(1);

... 


  • Initial UI setup is now performed uniformly using attachUIComponent

//     Initial UI Setup

Before,


myAudio.setDisplayContainer(myPanel);
myAudio.setUIPlay(playAudio);  
myAudio.setUIPause(stopAudio);
myAudio.setUISeeker(audSlider);
      

Now,   



        myAudio.attachUIComponent(AudioUI.UIComponent.CONTAINER, myPanel);
        myAudio.attachUIComponent(AudioUI.UIComponent.PLAY, playAudio);
        myAudio.attachUIComponent(AudioUI.UIComponent.PAUSE, stopAudio);
        myAudio.attachUIComponent(AudioUI.UIComponent.SEEKER, audSlider);



  • Fixed issues with the rendering. 

Now, AudioUI can render short bits as well as long audio files (<100 ms  to 3 hours ). 

AudioUI automatically decides to utilize a single core or all the cores available based on its duration to ensure fast rendering of the data. It uses NonTrivialAudio#getAudioNormData_multicore for large audio files. 


  • Added setMute, isMute and toggleMute option. 

  • Other minor bugfixs and performance updates.   

Created MultiChannelAudioUI for interacting with multiple channel / displays with a common set of controls. Read all about it here

No comments: