Reading a wav/ogg file with Tarsosdsp(Android) - audio-processing

I searched the web for an example to read a wav or ogg audio file with TarsosDSP library for android but couldn't find any.
Please provide me with brief code example for android to load an audio file from android's resource directory R.raw.audioFile into TarsosDSP.
I tried PipedAudioStream but it requires a string input while R.raw.audioFile returns an int.

Related

Getting the duration of an mp3 on a website

I'm using NAudio.Wave in my Xamarin Forms app. I have an mp3 file stored both on the device and can get the duration quite simply using NAudio. However, I also have an mp3 file on my website and need to find the duration of the mp3 file.
Can I use NAudio.Wave to find the length of the mp3 without downloading the file itself?

App Inventor sharing files No Activity found to handle Intent { act=android.intent.action.SEND flg=0x1 (has clip) (has extras) }

I'm a beginner at App Inventor and I don't know what I'm doing wrong with the sharing component. I'm trying to share a sound file but it gives me the following error:
No Activity found to handle Intent { act=android.intent.action.SEND flg=0x1 (has clip) (has extras) }
The code is the following:
I also tried the following things:
This doesn't work.
This reproduces the sound perfectly. That means that the picker works and the file exists.
I put a file in my root folder and it works but I want to send the file which was picked from the list which is in the following folder "/storage/sdcard0/MyDocuments/Downloads/app_inventor_1431867799168.mpeg".
I don't know where is the problem and I look in a lot of forums and none of the solutions solved my problem.
Thanks for your help.
PD: I just found that the downloaded files are stored in .MPEG format which it is a compressed format. It is possible that sharing function don't find any app that accept this type of format. If this is the problem please tell me what I have to do to make App Inventor to not change the original .mp3 file.
ok, problem solved as I said in the PD part the problem was that by default App Inventor stores the audio files in to MPEG format. This format is not recognized by whatsapp, gmail, etc...
Solution was to set a name to each file when I download them that ends with .mp3
With this extention the programs of my device recognize them and now I can share my audio files.
Thanks to everyone that was trying to solve this problem.

Writing QuickTime components for custom container and codec

I am new to Mac programming and as the title to this post suggests I have some questions on how a component for QuickTime is written. I have listed my questions as points, feel free to answer any, if not all, of them. Thanks in advance.
Which QuickTime component type is for codecs? Is it image decoder component type?
What component type is for custom containers? (Non .mov files)
How does QuickTime determine appropriate container and codec handler? Does it query every component listed under '/System/Library/QuickTime' until it finds a component that works?
I looked into projects such as Perian which have '.exp' files which export names like '_AC3MovieImportComponentDispatch'. With the prefix '_AC3' how does component manager recognise this as a dispatch function?
I created a 'test.component' bundle with very similar Info.plist as other components files and placed them under '/System/Library/QuickTime'. Component Manager documentation suggest they are registered 'automatically'. When do new component files for QuickTime get registered? Is call to 'RegisterComponentResourceFile()' necessary?
My system is:
Mac OSX 10.4.11 Tiger
For information about writing file container reader and decoder for QuickTime 7 go to http://sanje2v.wordpress.com/2014/08/02/writing-file-container-reader-and-decoder-for-quicktime-7-faq/

Get infomation of the media file when open an OPENFILENAME dialog

How do i get duration,album,singer,etc of a media file,not only mp3 format but including video file also in MFC, i have opened an OPENFILENAME dialog and want to retrieve the media file' infomation when select on a media file. please help me to get over it. Thank's so much!
Use IShellFolder2::GetDetailsOf
Here is a discussion in a German forum but you can easily extract sample code there.

Copy/Paste Audio Samples in Cocoa

I am creating a little audio editor using the Cocoa frameworks for Mac OS X. I implemented "copy" by writing the selected samples to a temporary WAV file, then using NSSound to load the URL and then push the data to the pasteboard (writeToPasteboard:).
Now I am working on paste. I create an NSSound from the pasteboard and am now stuck. How do I get access to the samples?
You don't. NSSound doesn't give you access to raw sample data.
You'll need to use the Audio Toolbox framework instead. It provides two APIs for reading and writing audio in files: Audio File Services is the lower-level of the two, whereas Extended Audio File Services supports compression and other features.
You may want to use the callbacks-based APIs in Audio File Services, since these could save you from having to use a temporary file. Instead, you'd set an NSMutableData object as the “client data” of the audio file, then implement “write” by copying the bytes into the relevant range of that data (setting its length first if needed) and “read” by copying some range of the data out.

Resources