How to play .ogg files using xcode - xcode

I want to play 3 different file formats .mp3, .wav, .ogg. I used AVAudioPlayer and managed to play mp3 and wav files but it isn't playing .ogg files. How to add .ogg support for my Xcode project.

AFAIR, it's not directly supported by the frameworks, but the format/standard is open, and multiple open readers exist. It's a container so... you decide the level of support you need.

Related

convert .avi video file to .mha

For a research project I collected videos of the microcirculation in patients. For automatic analysis of these videos I need to convert the .avi files to a .mha file format.
I am not sure if this is even possible. But if anyone could help?
Thank you in advance.
I am not at home with these kinds of files. What I tried so far: Converting the .avi file to .png files and then using 3DSlicer software to convert the .png file to .mha. However would potentially create hundreds of separate .mha files for one .avi file.

is there a way to tag video files independent of any tool

We are in the 21st century and still there is no good way to tag photos and videos? There is always a dependency on some tool... Is there no way to make the file autonomous with respect to its tags?
Video files, for example, are not friendly to tags. some video formats do not allow tagging at all. Some tools keep the meta data in their own external representation and when you copy the original file to some new destination, the meta data of the file in the destination is lost. Also this metadata may only be seen by this proprietary tool and is not seen by other tools (e.g. tagging by Adobe products are not visible/searchable in Windows Explorer)
Is there a universal way to tag any file including video files so that
searching for files having a certain tag is possible in any tool
when a file is copied, the tags are transferred with it
when the file is edited in any tool and re-saved, the tags are not lost...?
There are no universal ways at this point, if there ever will be one.
Probaby the closest we got is file tagging provided by popular OSes based on a certain file systems' feature called 'forking'. By this means Windows and Mac provide an ability to easily add meta data (including keywords) to any file on the file system, without changing the file's content. One serious drawback of this feature is that it does not cross file-system's boundary, i.e. if you simply upload a file to the web, or copy it to a different type filesystem - the metadata will be lost. There are ways to copy such metadata but that requires consideration and use of appropriate tools.

What is the recommended extension for HLS chunks / segments? Are there recognised alternatives?

I'm using ffmpeg to create HLS chunks AKA segments. I'm trying to find recognised extensions for HLS chunks.
All the documentation I've seen only ever uses a .ts extension when using ffmpeg ... something like this:
-hls_segment_filename "${outPath}/v%v/chunk%d.ts"
Is there an alternative recognised extension, since I'm working within a TypeScript project and TypeScript files also use a .ts extension and this is causing a conflict with various tools.
I don't want to use a non-standard extension for HLS chunks if I can help it. Are there any other known extensions for HLS chunks? TIA
Any pointers to documentation would be most welcome.
As #Gyan said in the comments there are 2 extensions available for HLS namely .ts or .m4s
This is confirmed here by Apple
Apple explain that .ts files are MPEG transport stream video files and .m4s files are Fragmented MP4 video or audio files.
You can't just change the extension willy nilly though. You need to generate the files using certain ffmpeg flags.
To generate .ts files use this flag (along with your other ffmpeg hls options):
-hls_segment_filename "${outPath}/v%v/chunk%d.ts"
To generate .m4s files use these flags:
-hls_segment_type fmp4
-hls_segment_filename "${outPath}/v%v/chunk%d.m4s"
Nice post on Fragmented Video here
In performance testing I found .m4s to perform worse than .ts (in terms of seek speeds)

ffmpeg - creating manifest file for smooth streaming

I'm new to ffmpeg (and video encoding), and i'm trying to understand how do i create a manifest file for IIS
i've tried creating the .ismv filem but it did not create the manifest file, i've saw the ismindex tool under the ffmpeg tools folder, but didn't quite understand how to use it.

Protecting files in desktop Mac .app

I'm mainly write iPhone apps but am familiar with some desktop Mac authoring. I need to create a Cocoa app that will include several wav sound files (included in bundle). I don't want a user viewing package contents of the .app file and then extracting all of the sound files from it. Is there a way to protect those files?
Here are some possibilities, depending on the effort you feel like putting in:
Encrypt the files
Change the filename and extension to make it less obvios that they're sound files
Embed the sounds inside an executable file, as a custom Mach-O
section
Strip any headers from the files, and store just the raw
samples
Write a program to convert the audio data to C array
declarations, and compile into the app
Just don't worry about it. Nobody's
going to "steal" your sounds, and if
they did, so what?
You can encrypt them. That's about it.

Resources