How to get current segment fron m3u8 in Android? - android

I have online translation m3u8. This translation consist of many *.ts files, where every file is 3 seconds video segment. I want to get current played sound from this stream. I try to get sound from one *.ts and I think I can. But how I can get current segment?
Maybe somebody know the ways, how to get sound from online translaition?

Related

Is there a way to get the pace and pause duration in an audio file in android?

I have audio files in mp3 and wav format, I want to be able to get the pace of the audio (how many words spoken in a second) and the average pause duration . I searched but I couldn't find any library or anything in the docs.
Anyone got a tip?

How to extract a section of audio using ExoPlayer?

I would like to extract a selected interval of an audio track (e.g. 10s A-B interval) and then export it in a consistent format (regardless of the source file format).
I started by trying to load local file as a stream and then the idea was to save audio buffer and use MediaRecorder to encode it. But after a lot of struggles and virtually no progress I hope someone can at least point me into the right direction.
Note: Workarounds where the user has to play the segment while the app records it via MIC will not be accepted.

How to identify the start of a song in a big video file

I am looking for a way to tag the start and end of a song(s) in a video file.
I am targeting below video formats for now.
1) 3GPP (.3gp)
2) MPEG-4 (.mp4)
I referred to the article http://bigflake.com/mediacodec/ and Android Extract Decode Encode Mux Audio and was able to get an idea for extracting demuxed, encoded audio data, however i am not sure how to identify the start of a music (not normal audio) in this audio file.
Target OS is Marshmallow.
Please suggest if this is possible, the answer i am looking for may need audio signal processing, unless there is an easier way to do it.
A theoretical way would be to use Transloadit, a program that would turn a song into a waveform. Then create a program (I think Python would do decently well) that can identify the start of the waveform and load it into a library. Then, in that library, you place the songs and their charts together, and if a song plays, you can then also run Python, which would detect the location of the source of current music and find the chart there and get the corresponding song name.
This will take a lot of time.
Transloadit waveform generator
Using PIL (Python Image Library) to detect image on screen from StackOverflow - first answer will help you.
If you need help with the libraries, then just ask me.
I'm sorry, but I don't have any major Android knowledge cough cough none.
Sorry, but you might need to search up some tutorials or try to use Python.

Getting unstreamable error with AndroidBreakout

I've been exploring the documentation and examples at http://bigflake.com/mediacodec/ by Fadden, and applied patch http://bigflake.com/mediacodec/0001-Record-game-into-.mp4.patch to the breakout game. Unfortunately, after compiling the code, I realized it doesn't work, producing video files that aren't streamable.
I see the following error:
"The mp4 file will not be streamable."
According to Fadden, this should be fixed by checking the mBufferInfo.flags (https://stackoverflow.com/questions/23934087/non-streamable-video-file-created-with-mediamuxer), which is already done in his code, so I'm at a complete loss. Did anyone else get the video recording patch to work?
The warning you're seeing is just a warning, nothing more. MP4 files aren't streamable anyway in most cases, in the sense that you would be able to pass the written MP4 over a pipe and have the other end play it back (unless you resort to a lot of extra trickery, or use fragmented MP4 which the android MP4 muxer doesn't write normally). What streamable means here is that once you have the final MP4 file, you can start playing it back without having to seek to the end of the file (which playback over HTTP can do e.g. with HTTP byte range requests).
To write a streamable MP4, the muxer tries to guess how large your file will be, and reserves a correspondingly large area at the start of the file to write the file index to. If the file turns out to be larger so the index doesn't fit into the reserved area, it needs to be written at the end of the file. See lines 506-519 in https://android.googlesource.com/platform/frameworks/av/+/lollipop-release/media/libstagefright/MPEG4Writer.cpp for more info about this guess. Basically the guess seems to boil down to: "The default MAX _MOOV_BOX_SIZE value is based on about 3 minute video recording with a bit rate about 3 Mbps, because statistics also show that most of the video captured are going to be less than 3 minutes."
If you want to turn such a non-streamable MP4 file into a streamable one, you can use the qt-faststart tool from libav/ffmpeg, which just reorders the blocks in the file.
You can check Intel INDE Media for Mobile, it allows to make game capturing and streaming to network:
https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials
simplest capturing:
https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials-video-capturing-for-opengl-applications
youtube streaming:
https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials-video-streaming-from-device-to-youtube

How do I read time samples of audio files in Android?

I want to write an app on Android to record snoring sounds of a sleeper and analyze it afterwards (i.e., not in real-time) for signs of a medical condition called obstructive sleep apnea.
The Android devices I've experimented with have voice recorders that produce a file format called .3ga. I want to programmatically read in the audio file and look at the amplitude for each individual time-sample. Then I can analyze that for patterns. Would this be easier if I converted this to a different format, e.g., MP3, and if so how can I do that programmatically?
I did a Google search on this and most of the hits seemed to be related to audio recording or playback which are unrelated to what I'm trying to do. I haven't coded anything yet because I don't know how to get started.
You are looking to do sample-based analysis on a raw audio signal, but the formats you mention are compressed. You will need to either deal with raw samples directly, or decompress the audio and then analyze.
Since you said you can do this work after-the-fact, why not upload to a server and analyze there?

Categories

Resources