Writing MP4 tags for M4A or MP4 audio files - mp4

I have a strange problem with MP4 tagging.. I can figure out 2 styles of tags, one that works with mp3tag and tagscanner, another that works with MusicBee.. But I can't figure out one that universally works with all of those. So I write 2 sets of tags into the file...
and even this isn't enough.. Players like AIMP and Clementine still can't read MP4 files I tagged this way. I need to open mp3tag load my files and save them.. then it will write tags that those music players understand.. but I can't find good documentation anywhere.
Does anyone know what kind of tags I need to write to make all of them be able to read the tags? I tried to look mp4s that work in all of them and it is no use, I see tags like "Artist".. I already write a tag called "Artist".. I mean it looks like "Artist" in exif also, this is the tag that I wrote that MusicBee understands.
I use the AudioGenie Windows Library to write the tags. There are 2 different methods for writing a tag.. one is called an ISLT text frame (which I have no idea what that is) and requires an integer code as well as text when writing. Another is called an iTune text frame and requires a string frame ID as well as text.
I tried to shove MP3 ID3v2 tags in both of those as well, to see if that was what the third group of players that can't read my tags wanted. But that didn't work. I only tried this because I read somewhere that ID3v2 tags are widely used in MP4 files (it was only on one comment in stackoverflow that I read this, so I'm skeptical)
Could someone point me in the right direction?

Related

use ID3 tag to collect information

I'm playing around with a .mp3 file and I'd like to imbed some code that prompts the listener for information (i was thinking a javascript popup) when the file is played. I've been reading up on ID3 tags and there seems to be some neat functionality built into the 'Audio Encryption' or possibly into the 'Generate Encapsulate Object' frames, but I cannot seem to find any good examples. I am assuming that if the tags can contain links I should be able to collect some data when the file is played.
No, ID3 in general does not support this. Only ID3v2, i.e. in versions 2.3.0 and 2.4.0 you could use
a WXXX frame, see https://id3.org/id3v2.3.0#User_defined_URL_link_frame while
a GEOB frame you might mean is more like an attachment for files, see https://id3.org/id3v2.3.0#General_encapsulated_object
How you're able to extract frames (let alone ID3v2 in general) out of an MP3 file with JavaScript is another problem.

Prepending a header to a headerless .m4a file

I have some .m4a files that were captured from a radio broadcast stream. They are playable using mpd (an open source Music Playing Daemon for *nix), but iTunes won't open them (nor will several other music players that should be able to play .m4a files). When I looked at the file in hex format, and compared it to an .m4a file from iTunes, it appeared that the file from the broadcast stream did not have any header info.
So I figured I'd try prepending some header info to the file, to see if that would make it playable by these other players.
I've tried to read the technical doc about the .m4a file format to understand how the header is structured, but it's far too complex for me to follow (most of the doc is about the coding, which isn't pertinent to this). The header seems fairly simple, conceptually - I can see 4-character tags, variable length data, and there are presumably some length codes to allow these to be split apart. It doesn't seem to contain any significant data about the actual audio data (like its total length), making me hopeful that I might be able to get by by simply copying the header from an .m4a file and prepending it to these headerless files.
I'm unable, though, to manually parse (that is, reverse-engineer) the header in order to even experiment with this. Can someone describe how to identify a complete header at the front of a .m4a file?

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.

Looking for a way to output the top viewed youtube video to a text file for a search term

I would like to output just the top youtube video for a particular search term, e.g Tennis to a text file. Command line options are what I prefer but am open to other solutions.
You can fetch the data you need in XML format from YouTube's API.
(Note: The results may differ from the HTML website)
Then parse the XML with anything you want, e.g. Perl's XML::LibXML::XPathContext. It's a bit fiddly though, if you haven't used that module before.
Once you have the video URL, you can pass it to youtube-dl.

Streaming and playing an MP3 stream. .mp3 URL format

I used the sample code from http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html. it runs OK with default URL. But when I replace with my URL "http://dl.mp3.kapsule.info/fsfsdfdsfdserwrwq3/fc90613208cc3f16ae6d6ba05d21880c/4b5244f0/b/7e/b7e80afa18d06fdd3dd9f9fa44b51fc0.mp3?filename=Every-Day-I-Love-You.mp3", this app shows an message as "Audio not Found". But when I put my URL on Address Bar of Web Browser, I can download this .mp3 file.
really, I can't understand why it is?
pleased tell me!
Thank you very much
My guess would be that the app is designed to play a MP3 encoded audio stream with no limit in length (which is different from your ordinary music file). To set this up, you need a streaming server on the client side.
I think you can find out for sure by trying with a different radio station that transmits in MP3. If that works, it's most likely that your app doesn't like your file.
You should, as Vivek recommends, also try using a simpler download URL for your file, in case the App gets confused by the URL's length and/or structure.
As mentioned, this is due to the URL of the file. The AudioStreamer code specifically checks for the extension of the file and tries to figure out the audio type based on that. If you change that logic to handle your custom URLs, it will start working
So to point you in the right direction: open AudioStreamer.m and look for the references of
hintForFileExtension:
This function returns the type of file based on the extension. If you know the file type won't change (always mp3), the quick and dirty solution is to always assign mp3 type without any logic... like this:
err = AudioFileStreamOpen(self, MyPropertyListenerProc, MyPacketsProc, kAudioFileMP3Type, &audioFileStream);
Note: I've put kAudioFileMP3Type constant instead of calculated value
PS yes, it does work with static mp3 files, even though it's designed for streams and hence misses some of the functionality one would expect from a player that plays a static file on the server (caching, prefetching, proper seeking)
Thats because the default url directly points to a file in the webserver, whereas the the url you've mentioned is a HTTP (POST/GET) operation, which the application may not be designed to handle.
I suspect that your URL is one-time-use. When I try to visit it, I see 408 - Request Timeout.
Many links on mass file sharing websites are like this. If you could download the file directly, you wouldn't sit through a page of ads and premium account offers.
Try again with a file on a normal website, like this one.