gettin play count for files played using mediaelement - audio

I am using mediaelement js module in drupal 7 to play an audio file. I need to track the no of times a file has been played.
Is there a module for solving my purpose? or can anyone help me about how to start with a custom module for the same?

The Download Count module should so what you want, since playing a file is the same as downloading it.

Related

Easily differentiate video files from image files in Node

I'm building a project where people can upload files, I would like to then display those files in a browser where people can interact with them (vote, comment etc)
However, this means I need to programatically build the html depending on the format of the video or image. Is there a way to feed a file (or filename) into a library, and determine whether I need to display it in a video element or an image element? Even a list of video formats vs image formats would help but I haven't seen anything in regards to that.
No module can reliably determine the file type. The user could either change the extension or even the magic number of the file to obfuscate it. The only reliable way it to try to pass file to some image / video transcoder to let it decide or error out if the format is invalid. This way you know you are working with known formats since all files are transcoded to your specific extensions. That could be mp4 or png. I recommend using handbrake for videos and sharp for images. Leaving the NPM links down below:
https://www.npmjs.com/package/handbrake-js
https://www.npmjs.com/package/sharp

TCPDF - generating a PDF within browser but also playing an audio

I'm writing in raw PHP on Linux using the tcpdf library.
The core question is that while creating a PDF with tcpdf I'd also like to kick off an audio file for the user...but tcpdf considers that TCPDF ERROR: Some data has already been output, can't send PDF file so I'm looking for a way to play an audio file at PDF generation without tcpdf considering that 'interfering output'.
I can successfully generate my wanted PDF within my browser using the tcpdf library and calls. But I would also like to play an audio when this happens - that might say "This is your generated PDF. You can print it now...etc"
So I'm wanting to put the HTML audio syntax within my php script.
However if I try to include an audio clause before the tcpdf->output, tcpdf will play the audio but say that output has happened before the tcpdf output and will not generate the PDF image. Flow stops after the tcpdf->output command - it successfully generates the PDF but it does not return for additional lines so I can't place the audio line after the output call.
So I guess I'm looking for a "hidden" audio although I've tried hidden attributes within the HTML audio syntax but still tcpdf flags it as "output has happened". Thank you.
Well, obviously, you can do that simply by
generate the PDF into file (not to the client directly -- 'F' switch).
output your audio file to the client and let it platy
output a link/Javascript redirection to the generated PDF file.
Because you didn't provide any code in your question I do not provide any either, but I believe it is already understandable.

play a dynamic sound file in asterisk musiconhold

I have used asterisk MusicOnHold with that I have to point a particlar folder in musiconhold.conf and during the execution all the tone inside that folder are played for all the users.
But now I have to play a specific sound file for each user uploaded by them.My problem is that how can I play this file for user.Because if he uploads a sound file then I have to manually create a class in musiconhold.conf pointing to that folder the do moh reload.
I just want to automate the things to the user just uploads the sound file and during the call of that user in extensions.conf I can point to that sound file and it will be played without reload or adding context in musiconhold.conf everytime.
For ex. the way Playback(pathToSoundfil) works which takes tone path directly is there any function like in musiconhold for directly passing the sound file?
Thanks
You can do as many section in your musiconhold file as you want.
After that you can use thoose class
No, you can't change classes without reload res_musiconhold
However you can use asterisk realtime architecture and put whole config into mysql. Still need do script which will do reload.
If you want 100% realtime solution, you can use conference and play into same conference any file. Just create enother call to conference which play file. This variant require expert level in asterisk.

Getting info about an mp3 file in ios 5

How do I get the info about a mp3 file? I mean, like, the tags and the artwork? Any one?
I'm not entirely sure if this answers your question, but here goes:
Assuming you mean any kind of audio file that resides in the iPod library, this information is contained in an MPMediaItem instance. These objects can be obtained in various ways, for example by using the MPMediaPickerController. The MPMediaItem is contained in the Media Player framework.
Reference here:
http://developer.apple.com/library/ios/#DOCUMENTATION/MediaPlayer/Reference/MPMediaItem_ClassReference/Reference/Reference.html
Small Example:
NSString *songTitle = [MPMediaItem valueForProperty: MPMediaItemPropertyTitle];
Now, if you're actually talking about an mp3 file residing in your App's sandbox, the answer you're looking for is located in this thread: Reading MP3 information using objective c

How do you get audio into an iPhone app?

How do you display audio files like an imagepicker? I'm using the MPMediaplayer class but I can't get it to work. My requirement is to click on a tableviewcell, and have audio files appear like an imagepicker.
simple get the path of all audio files. and parse the name only from the path. store all the names in array and display in UITableView. just read about how to use nsfilemanager.

Resources