Trying to upload and align CSV, Video and audio file into Matlab - matlab

Hi I am relatively new to Matlab and need to analyze data for a research project. Basically I am importing .csv file into matlab as well as a video and audio file in order to see if I can find a correlation. I've successfully imported the csv file but I am unable to import video and audio. Furthermore once I have uploaded it into matlab I need to align the data from the CSV file and audio and video.

Matlab has several built-in utilities for this.
Try using the VideoReader and audioread to import your video and audio respectively. You can look at the Matlab documentation for each of these functions for more information on their properties.
The last part of your question is too vague. You need to specify what format the data from the CSV is in, what its relationship to the video is, and what kind of alignment you want.

Related

Download Result of Source Destination (Web Audio API)

I'm building a tool to edit audio with the Web Audio API.
Here is where I'm stuck:
...
source
.connect(gainNode)
.connect(analyser)
.connect(analyser2)
.connect(audioCtx.destination);
};
What I've written (which ends with the code above) successfully allows the user to upload a file, apply effects, and listen to it on play(). How would I then allow the user to click a button to export the results to a WAV file?
I've tried several methods online that have not worked for my use case.
Please let me know if more code is needed. Thank you for taking a look!
If you want a WAV file, I think you have to do that yourself. WAV files are quite simple. In this case, you'll need to add either a ScriptProcessorNode or AudioWorkletNode just before the destination to capture all the audio and convert it to a WAV file that can be downloaded.
If a compressed file is ok, you can look into MediaRecorder to save the data for you.
I ended up solving this by writing an entirely different script to download the file using OfflineAudioContext.
My original script plays the audio with effects, and the second script downloads it with the same effects. Now to figure out why there is latency on the effects while using OfflineAudioContext.

Split a movie file into audio and video Psychtoolbox

I am working on a project where I have to split a movie file into its basic audio and video parts first. After googling and through documentation and psychdemos in psychtoolbox, I am unable to find even a clue to this issue.
Is there any function in psychtoolbox to split a movie clip like .mpeg or .mov or .avi or .flv into its audio and video parts ?
Please help.
Thanks a lot for your consideration.
First off, it is key to realize that pyschtoolbox is well simply a toolbox. There is a host of other built in MATLAB functions that you can use along with pyschtoolbox.
It looks like even in MATLAB, doing this is a pain in the a$$, but I did find this untested by me FEX entry. http://www.mathworks.com/matlabcentral/fileexchange/8028-mmread
It looks like it should be able to do what you want and it does not depend on purchasing other toolboxes, etc.
By the way, is this a project from elance.com?

Save video read from VirtualDubMod to file using command line only?

I want to compile several video clips using Avisynth on a server. I generate the .avs file and let VirtualDubMod read the file.
How do I save the video read from VirtualDubMod to an avi file using the command line only? If I open VirtualDubMod then I can choose save as but I am putting this on a server so no GUI will be available and it should be automatic.
EDIT:
After looking some more I found this. Is this a recommended approach?

How to change aurioTouch project to write recordings to .caff or .wav file

I'm investigating aurioTouch2 sample code.
I wanna change smth to record audio from microphone and to write these data to .caff or .wav file. So later I will be able to play this audio with AVAudioPlayer.
My idea is to use AVAudioRecorder in applicationDidFinishLaunching, but may be it's not the best solution or may be even it's not possible by this way (I've not tried to use AVAudioRecorder, because I think that most likely it's not the best idea).
I've tried to write byte data in
void FFTBufferManager::GrabAudioData(AudioBufferList *inBL)
{
memcpy(mAudioBuffer+mAudioBufferCurrentIndex, inBL->mBuffers[0].mData, bytesToCopy);
// after this I copy to my own buffer and collect all the data during 30 seconds
}
So as you see, I copy to my own buffer and collect all the data during 30 seconds. Than I write data to .caff file. That doesn't work.
Update:
Or may be the way of playing binary data of audio (not encoded to .waf or .caff audio) exist?
There's a few different ways to do this. One approach is to use ExtAudioFileWriteAsync.
Apple provide a sample project that demonstrates how to do this. It's RecordAudioToFile.
Have a look at some other posts as well, e.g. Can anybody help me in recording iPhone output sound through Audio Unit
I am not sure if I got you correctly but you can't just write the buffer to disk. CAF and WAV files need their own headers and encoding of the audio data. The AVRecorder class does this for you. There are plenty of questions on this topic. See for example this question.

Record audio, add effects, then save result to a audio file

I am having trouble doing what the title said. My goal is to be able to add any desired effects to your recording, save the modified audio, then send that to a server.
I have searched the fourms and came across these threads:
viewtopic.php?f=7&t=13029&p=45362&hilit=saving#p45362
viewtopic.php?f=7&t=12660&p=44586&hilit=saving#p44586
viewtopic.php?f=7&t=13178&p=45746&hilit=saving#p45746
After reading those, I see it is possible to save the modified audio, but can it only be saved as a wav? Like I said after it is saved it will be sent to a server, so size is a big deal and wavs are relatively big compared to other formats. Ignoring that fact, I tried to implement FMOD_OUTPUTTYPE_WAVWRITER and I cannot get that to work; are there any good examples of using it? I looked though the examples in the library but I didn't see any..
But the basic structure of the app is to record, turn some switches off and on to see what filters you want, preview it, then press a button "Save" that will save it. What would this save function consist of?
Any help appreciated, thanks.
Using FMOD_OUTPUTTYPE_WAVWRITER is fairly straight forward, you set the type via System::setOutput, specify the output file via System::init extradriverdata. The extradriverdata should be an absolute path to a writable area of the device such as the documents directory. After you have finished playing, call System::release and the file will be complete.
The other option for recording wave data with effects is by creating a custom DSP and connecting it to the channel playing the recorded data. You will then get regular callbacks giving you float data that you must write out to disk yourself. You can find examples of DSPs and writing wav files in the dsp_custom and recordtodisk examples respectively.
Finally note that FMOD doesn't come with the facility to write compressed audio to disk, you will need another API to achieve this goal.
You can save as an AAC file via the ExtAudioFile API.