I have a recorder application(CSHARP) where i use NAudio to record/playback audio. Our need is to Insert and overwrite audio in an existing wav file.
Currently, for inserting audio, i use the current position of the wav file and do a split. Merge the new wav file to original one and merge with the rest of the file.
When overwrite, i take the current position of the original audio and merge the new audio from that position.
This process seem to work ok but for some reason i think reading the file and writing a file takes a big toll. When we do a fast recording,stop recording, rewinding, recording, stop recording and so on.. the request to file gets clogged up and at some point i get File IO exception error saying "The file is in use by another process.."
(Note: We use a footpedal equipment with 3 keys assigned for recording, play and rewind. The issue we have is when we bang on the pedals faster.)
i am really stuck at this point as i am unable to resolve this issue. I will need some expert help.
Is there a way to insert audio from a specific position in a file without doing Split and Merge? PLSSSSSSSSS Help!!
Overwriting audio in a WAV file is not too difficult, and when I need to do this, I use a customised version of WaveFileWriter that can open an existing WAV file, and lets you reposition within the data chunk.
Inserting on the other hand is always going to be problematic, since you need to shift all the audio after the insert point forwards. I'd be tempted to create a separate "insert" wav file, and then after your whole recording session is finished, stitch the parts together into a final WAV file.
Related
I have several MKV files in several folders. I wanted to be able to add a Video track & Audio track that is supported by my TV.
It's ALL MKV files (but in multiple different folders)
Obviously I do not want to add another track if the required track already exists
So let's say I got a MKV with a DTS Audio track. After the convertion the MKV would both have the original DTS Audio track and a AAC Audio track.
I am thinking of a powershell script where I run a command to extract information about existing tracks and the based on that add required tracks.
If anyone can point me to the right tool I would be very happy.
UPDATE:
I found that "mediainfo" seems like a great tool for the "get information about the mkv part". Which means that I only need a tool for the update mkv file part
I'm using NAudio for a project that needs to record voice using the microphone. The NAudio project has a very nice demo that shows how to record a wav file, but since I need to transfer the voice-data to a server using webservices, a wav file is often too large.
Therefore I was wondering if it possible to do the same in MP3 or AAC directly. In this article I read that it is not possible to encode to any other format using (memory) streams and that file paths are required. I cannot assume that my client application has access to the file system.
Is there any way to create or encode an MP3 file directly without using the filesystem?
Thank you in advance!
I'm afraid NAudio doesn't currently support doing that, but one technique that you could try is to use Lame.exe and pipe PCM into stdin and read the MP3 converted output from stdout.
I am working on file upload and really wandering how actually chunk file upload works.
While i understand client sends data in small chunks to server instead of complete file at once. But i have few questions on this:-
For browser to divide and send whole file into chunks, Will it read complete file to its memory? If yes, then again there will me chances of memory leak and browser crash for big files(say > 10GB)
How cloud application like google drive droopbox handles such big files upload?
If multiple files are selected to upload and all have size grater than 5-10 GB, Does browser keep all files into memory then send it chunk by chunk?
Not sure if you're still looking for answer, I been in your position recently, and here's what I've come up with, hope it helps: Deal chunk uploaded files in php
During uploading, If you can print out the request from the backend, you shall see three parameters: _chunkNumber, _totalSize and _chunkSize, with these parameters it's easy to decide whether this chunk is the last piece, if it is, assemble all of the pieces as a whole shouldn't be hard.
As for javascript side, ng-file-upload has a setting named "resumeChunkSize" where you can enable chunk mode and setup the chunk size.
I am currently seeking a solution whereby I can store accelerometer data into a file and retrieve the results by indexing into a file by CMTime. This way I can pass in a time value like 1.5 seconds and retrieve the motion data (stored as a plain text line)
AVAssetWriter allows me to write to a file and encode images/audio with CMTime and then retrieve using copyCGImageAtTime. However, I'm looking for a way, instead of images/audio, to store a plain text line with CMTime.
Overall, I am storing accelerometer data into a file every 10 milliseconds and once I finish writing to the file, I would like to index into a file using CMTime. Simultaneously, I will be writing a video file as well so that I can retrieve the frame associated with that CMTime. Another solution can include writing a line into the file to include the timestamp followed by the data, or perhaps encoding the accelerometer data alongside the video? But I would like to see if there is a better way of doing so.
Appreciate any thoughts.
I'm working with a GPS module that is transferring data to my mac over a serial RS232-to-USB interface. I've written a objC program that takes the raw data and converts it into meaningful information.
Using a program called goSerial, I'm able to log all incoming data into a text file. I have been able to make my program read the text file and process data line by line.
I would like this procedure to happen in real time i.e. as soon as the data is received, it gets logged into the text file and my program reads it. The first part of this happens automatically that is the text file is being constantly appended (when not open). Is it possible to monitor a text file for appended data and only read new lines? Also, will doing this affect the ability of new incoming data to be saved?
Thanks!!!
(Also, if anyone knows how I may send serial data directly to Xcode, please let me know!)
I'm not sure how the serial-to-USB affects things but traditionally, unix accesses serial devices using the Device-File Mechanism which treats the input from the device as a file to be read. You would use NSFileHandle to read the file from Cocoa/Foundation. You probably want to checkout the IORegistryExplorer app to see how your device shows up.
You can use a kqueue (perhaps with a wrapper such as UKKQueue) to watch the file for changes.
You should be able to create a unix domain socket, which you can then have your goSerial application open (as it looks like a normal file on the fs)
And then read from the other end, linewise in your application. This is probably the easiest way, or alternately have a look at the source of tail in GNU's coreutils, specifically it's -f function (although thinking more you'll probably want to look at how the FreeBSD implementation works, as I believe that the GNU version uses some linux specific callback)