How to Record an Audio and Play in QML? - qt

I am trying an application where i kept three buttons one for play,record and stop.
When i press the record button,it should start record the audio by me. and after stopping it,when i play it.it should retrieve the recorded audio from the file,where it is stored.
I have tried using this link below,but could not find any solution.
https://projects.developer.nokia.com/audiorecorder/changeset/67519324bc6ea96ef956dec1b494eb3a5417402b
Can anyone find me a solution for this.I am badly in need of this solution!!!
Thanks in Advance!!!

As far as I know, you should call the phonon's MediaSource/MediaObject classes to do it inthe back end.
#include <phonon/MediaObject>
#include <phonon/MediaSource>
Phonon::MediaObject *mobj....;
I dont know how QML is written but this is how you get to play media files in Qt.

Your link seems to have a solution for Symbian only.
One general thing: There is no recording API for QML. But there are C++ classes in QtMobility Multimedia which do what you want to do, you just need to export APIs to QML (that's what you can learn from the example in your link)

Related

Streaming audio in A-frame

I am building a multi-user experience in A-frame using NAF, and I have some positional audio containing music tracks in different points of the scene. I'm trying to figure out if it's possible to make it that the music is listened simultaneously by all the connected users. It is very important that they are positional, since I need several audio sources in the scene. At the moment, the tracks start when you enter the experience, so each person hears them from the start when they access the scene. This is the file that I'm using right now: https://glitch.com/~indigo-roomy-supermarket
I tried with the broadcast-component, but didn't manage. I thought of trying a workaround using a stream of twitch and hiding the video, trying to project it to a primitive, but also doesn't work so far (just managed to attach it to a div over the scene, I can hide the video but the audio would never be positional). Here the file where I tried it (not networked, but it should be the same): https://glitch.com/~twitchtest-01 I know that there's the option of connecting vimeo to a-frame using this: https://github.com/vimeo/aframe-vimeo-component but the audio itself is not positional, so it doesn't really solve my problem (also, I don't know if it would work with vimeo live).
If somebody knows a way to do this, I would greatly appreciate if you can share your wisdom. Thanks a lot!
I don't think that's easy.
Assuming you have streaming audio servers at your disposal like this then the way I would approach this, is:
fetch an audio stream and once the download returns, get the source buffer
override the source buffer of your positional audio element (something like this.el.getObject3D('sound').children[0].source.buffer) with the newly created audio buffer.
This might work.
If it doesn't, then create you own audio element component by using positional ThreeJS sound directly with setMediaStreamSource.
My assessment would be that this takes several days just to prototype alone. Having said that, I am pretty sure it's doable.

Treeview for FileSystem with checkboxes in qt

We need a tree view with File system and check boxes in QT. Is there any way to achieve that?
The tree we need would look something like below:
UPDATE:
I am able to achieve it with subclass of QFileSystemModel. Still have few challenges, but at least subclass is working. Below is the code if anyone needs it. Below is the link to the code -
https://drive.google.com/file/d/1qViZ3iEW2pV2th0jQhzneDL14SEhIgS0/view?usp=sharing
The pending work is to apply a wait cursor (or make treeview uneditable when the check/uncheck is taking place).
PS: It will take a lot of time if root node is checked.
Well, all of that can be achieved with minimal customizations of built-in classes, actually those checkboxes is almost the only thing that has to be done yourself.
QFileSystemModel already provides a proper model for displaying the current filesystem contents, it can be subclassed
As for QML, the best demo is already provided by Qt, check the File System Browser Example. This example uses some deprecaded Qt functionality, but still it shows the basic concept.
The modern techniqes can be also found in the answers to the following question: Qt File Browser based on QML
Hopefully, all that helps you, good luck!

How to use JavaFX SimpleSwingBrowser in Processing IDE?

I had just found this website: https://docs.oracle.com/javafx/2/swing/swing-fx-interoperability.htm.
On this site, there is an example to create a SimpleSwingBrowser.
The problem is that I can't use this code in Processing and I don't know how I can edit it so it will work.
Is there a way to use the JavaFX SimpleSwingBrowser in Processing (If needed in a Swing Frame or something like that)?
Thanks in advance,
Daantje
I can't find a way to import JavaFX code into Processing, which seems weird because Processing supports using JavaFX as a renderer. It might be possible to import JavaFX code, but a quick Google doesn't reveal how.
But hope is not lost. You can also just use Processing as a Java library, and run your sketch that way instead of via the Processing editor. Here is a tutorial that should get you started with that.
Then when you have your sketch running via Java, you can create a JavaFX frame however you normally would.

Get information about pics and video files with qt

Well i have a project in which gets pics and videos from folders and also i can view them it it and when i view them i want to also see those tags kinda like the camera which took it, dimensions , the ISO, the exposure time and others for pics and camera model framerate and dimensions...
Thanks in advance
I've never seen anything like this in Qt. Anyway, Qt is a C++ framework, you can use whatever library you want to use. QImageMetaData and QMeta are very near Qt style, but can only be used for images (never tried those).
Anyway, I would use the XMP toolkit. You also mentioned videos, so in that case XMP can handle both. It is very simple to use, well documented and fast (license is BSD). It is written in C++, so you can port it on whatever platform you want.
I think Qt itself does not provide a way to extract exif data (which is what I guess you're trying to extract). You could perhaps try QMeta. I have not used this myself, so no guarantees.

.NET : How to Create thumbnail from flash

Is there any way where i can create a thumbnail image from a flash movie file(flv /swf) [NOT FROM A VIDEO File ] in ASP.NET ? Any samples of implementation ?
you can use ffmpeg to create thumbnails of the flash video
For .flv you can use ffmpeg to convert parts of the video (e.g. one frame) into an image (sequence)
I've used it as command-line application by calling Process.Start(), but there is at least one wrapper for .NET (I haven't tested it myself):
http://www.codeplex.com/ffmpegdotnet
For .swf I don't know any way to achieve this without some Adobe tool.
for flv it can be done easily, as others mentioned ...
for swf, it depends HIGHLY on the swf ... if the swfs visual appearence is determined by code, there is no other way than to embed a flash player in you app and either let the flash player make the snapshots, encode them as JPEG/PNG, and send them somewhere using TCP or LocalConnection (a flash<->flash communication connection, which can be used with C# as well) or try to somehow grab its output buffer yourself ... the first possibility should be no more than 10-20 lines of actionscript code ... don't know about the latter ...
other than that, you might use an external command line converter ... there are a few floating around the web ...
greetz
back2dos
Take a look at this article, it should point you in the right direction. It uses SharpFFmpeg to extract thumbnail images from movie clips from a variety of formats.
the only way to get an image, is to use a full flash client that starts playing and allows you to capture the first frame.
I would take a close look at flirt (they actually have an example that renders pngs)
Maybe some of the other flash libraries may be of help ( swfdec gnash swift tools gplflash)
Gnash is probably the best choice since its the most mature project out there, but i do not know how easy it is to integrate into command line tools or into your own projects.
We have been working on this in my company, and we got a proof of concept working pretty fast (but the project we made it for is on hold right now). I am not able to share the code, but I can give you some pointers.
It is not pure ASP.NET, but maybe you can still use it. We made a windows service that can be called from ASP.NET.
Basicly you install the flash plugin on the server, the windows services can then simply open the swf through the swf ActiveX component and then you can grap a picture of the whole thing. It works pretty well, notice that you do not have to actually render the ActiveX component on screen to capture the picture.
Check out this post. It does not tell you everything but I guess it provides the ground work required for it. You probably have to figure out how to get the object tag out of the flash-html you are trying to download from a web page. After that you'd have to figure out when to capture the frames. Its a long ride however. You don't need the asp.net part. Just concentrate on the windows project part. Hope this helps. :)

Resources