PDA

View Full Version : Help needed to develop an audio editor



franco.amato
23rd October 2009, 21:35
Hi to all,
I have to develop an audio editor with that features:

show the waveform of audio tracks
cut an audio file at 2 time points ( start - end ) drawing a rectangle over the waveform


Can I have a help from anyone of you? My qt experience is very poor.

Best Regards,
Franco

nightghost
23rd October 2009, 22:43
What exactly is your problem? Where do you need help?

The Storm
23rd October 2009, 22:50
I beleive that currently Phonon is not able to do the things that you want( or at least not in any clean way ). My suggestion is to use 3rd party library. My favorite is FModEx( which is free for non-commercial use ), but if you prefer open source you can try with OpenAL.

franco.amato
23rd October 2009, 23:17
I beleive that currently Phonon is not able to do the things that you want( or at least not in any clean way ). My suggestion is to use 3rd party library. My favorite is FModEx( which is free for non-commercial use ), but if you prefer open source you can try with OpenAL.

Yes I know fmod and I'm planning to use it. What I don't know and where I need help is in the design and development of the gui, averall in the part where I have to display the waveform. I would do something as Audacity ( designed using wxWidgets ) but with Qt.

If you want collaborate please letr me know. I can send a screenshot of what I would realize.

Best Regards,

franco.amato
23rd October 2009, 23:18
What exactly is your problem? Where do you need help?

In the development of the gui. Can you help?

nightghost
24th October 2009, 09:31
You dont know how to use Qt in general? Specific Widgets?

franco.amato
24th October 2009, 14:38
You dont know how to use Qt in general? Specific Widgets?

I just started studyng Qt 1 week ago.
What I would display is the waveforms of sound tracks as you can see in the images contained in the following link: http://www.guidesandtutorials.com/audacity-tracks.html
I think it's a drawing problem, and for me at the moment it's impossible.
I hope you can help me.

Regards

axeljaeger
24th October 2009, 23:54
Why not start with something more simple?

franco.amato
25th October 2009, 00:06
Why not start with something more simple?

This is a task I have to do for my job. I don't have problem with the audio part only with
the design of that widget as I said.
And for that I'm searching for help.

Can you help me?

Regards,
Franco

axeljaeger
25th October 2009, 00:11
Have a look at QWT for plotting stuff.

squidge
25th October 2009, 00:13
Then maybe you should use something you are more familiar with to get that job done until you are more at home with Qt. If you just jump into the deep end your going to have countless problems and your project will take forever.

You can then start with something simple with Qt and work your way up. Maybe even eventually port the application to Qt if you have time.

franco.amato
25th October 2009, 10:28
Then maybe you should use something you are more familiar with to get that job done until you are more at home with Qt. If you just jump into the deep end your going to have countless problems and your project will take forever.

You can then start with something simple with Qt and work your way up. Maybe even eventually port the application to Qt if you have time.

What I only need is an help to develop that widget, but seems impossible to get that help.
Can I have some guide line?

Best Regards

franco.amato
25th October 2009, 10:30
Have a look at QWT for plotting stuff.

Qwt is not the right choice in this case, I already gavce a look.
Seems something to draw to a dc.

axeljaeger
25th October 2009, 10:37
What I only need is an help to develop that widget, but seems impossible to get that help.
Well, you come here, tell us that you want to do something very difficult and that you have no clue and want some help.

The problem is that you did not ask specific questions. If there is some question that I can answer with "Yes" and "No" or when you give us some code and say: "Here it does not compile" or "there is a crash", we can help.

But till now it sounds like we shall do the work you get paid for.

If your company wants you to code some application in Qt and you have no clue how to do that, ask your company to get some paid training.

We are realy like to help you but we will not spend hours and hours on you try to figure out what your problem is. We like to help, but keep in mind we do this in our free time because we like Qt programming. If you are unsatisfied with our service, buy some support from Nokia.

franco.amato
25th October 2009, 10:46
Well, you come here, tell us that you want to do something very difficult and that you have no clue and want some help.

The problem is that you did not ask specific questions. If there is some question that I can answer with "Yes" and "No" or when you give us some code and say: "Here it does not compile" or "there is a crash", we can help.

But till now it sounds like we shall do the work you get paid for.

If your company wants you to code some application in Qt and you have no clue how to do that, ask your company to get some paid training.

We are realy like to help you but we will not spend hours and hours on you try to figure out what your problem is. We like to help, but keep in mind we do this in our free time because we like Qt programming. If you are unsatisfied with our service, buy some support from Nokia.

What I need is some guide line on how to build the widget where I should show the wave form of the sound track I will load. Something as you can see in the image in this link:
http://www.guidesandtutorials.com/audacity-tracks.html.

I don't want you write it for me ( also because I want to learn Qt ). I need an help on build it and If I can't I'll pay someone to write it for me, but at the moment I want to try to write it.

Thank you in advance.

Best Regards

axeljaeger
25th October 2009, 11:27
Subclass QWidget, reimplement paintEvent and mousePress/mouseRelease.

schnitzel
26th October 2009, 02:21
why don't you take a closer look at how audacity (open source project) did this particular waveform display and try if you can map it to something in Qt.
Qt has one of the best documentation of all its classes and very good examples. There surely must be one that relates to what you want to do.
If you still can't figure it out, at least you will have some better questions to ask.

good luck,
-a

franco.amato
26th October 2009, 04:13
Subclass QWidget, reimplement paintEvent and mousePress/mouseRelease.

Could you help me to build that widget? I'll post the code,
if you have free time.

franco.amato
26th October 2009, 04:15
why don't you take a closer look at how audacity (open source project) did this particular waveform display and try if you can map it to something in Qt.
Qt has one of the best documentation of all its classes and very good examples. There surely must be one that relates to what you want to do.
If you still can't figure it out, at least you will have some better questions to ask.

good luck,
-a

I tried to do that but's very complex and audacity has a lot of things I don't need.
I only need to draw the pcm sample's amplitude ( waveform ) and add the possibility to the user to do selection with the mouse over them.

axeljaeger
26th October 2009, 08:32
Could you help me to build that widget?
If you show me your code, I will have a look at it.

franco.amato
29th October 2009, 02:37
If you show me your code, I will have a look at it.

Hi,
I started writing some code.
The class interface:


#ifndef __WAVEFORMDISPLAY_H__
#define __WAVEFORMDISPLAY_H__

#include <QWidget>

class WaveFormDisplay : public QWidget
{
Q_OBJECT

public:
WaveFormDisplay( QWidget* parent = 0 );

protected:
void paintEvent( QPaintEvent* event );
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);

private:
};

#endif //__WAVEFORMDISPLAY_H__

And the methods:

#include "waveformdisplay.h"

WaveFormDisplay::WaveFormDisplay( QWidget* parent /* = 0 */ )
{
setPalette( QPalette( QColor( 250, 250, 200 ) ) );
setAutoFillBackground(true);
setWindowTitle( tr("Waveform display") );
resize(500, 200);
}
// Paint event
void WaveFormDisplay::paintEvent( QPaintEvent* event )
{
QLine line( 0, height() / 2.0, width(), height() / 2.0 );
QPen pen( Qt::blue, 1 ); // red solid line, 1 pixels wide

QPainter painter( this );
painter.setPen( pen );
painter.setRenderHint( QPainter::Antialiasing );

painter.drawLine(line);
}

// Mouse press event
void mousePressEvent( QMouseEvent *event )
{
event->accept();
}

// Mouse move event
void mouseMoveEvent( QMouseEvent *event )
{
event->accept();
}

// Mouse release event
void mouseReleaseEvent( QMouseEvent *event )
{
event->accept();
}


Do you already have some suggestions? Code is just to start and I already got linker error about mouse event :(

axeljaeger
29th October 2009, 08:36
If you would have shown as the error message of the linker, it would be a lot easier to help.

Anyway, in this simple case I guess you just forgot the WaveFormDisplay:: in the method signature of your implementation to the linker does not know that the three mouse-event-handler belong to your class.

But also some comments to your code:

Why do you "accept" the mouse-events already?
Although it is good to write documentation, you "document the obvious": http://freeworld.thc.org/root/phun/unmaintain.html