|
Dan_K wrote: As I said earlier, this WAV file is not in PCM format
sox donot require pcm formats as source file, to convert to PCM format.
long back, i used this exe, to convert wav files in gsm format to pcm format. iam not sure of what is the input format you are using, and if sox supports that format.
you can do the following things.
1.take a pcm file which is able to be played in a media player, and convert it to itself. i mean, pcm itself. if it works, it proves that, the exe you are holding is the right one. other wise, we will see an alternative.
2.put me a mail, attaching the sample file you are trying to convert, the sox.exe you have with you, and the source you have downloaded. i will try to help you at my best.
please find a mail in your inbox, where i stated my mail id.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Failing an understanding of how to use the code, you could always take the approach oft taken to using ffmpeg, and just include the command line exe in your release then run it from your program, rather than the cmd line.
Dunno if you could suppress the cmd-line window from appearing when you run the program, but the question is bound to have been asked a thousand times before, so somewhere the answer lies silently in wait.
|
|
|
|
|
Are you talking about ffmpeg source code itself or the one included in SOX (which I see in the folder)? Or are they the same? I had that separately long time ago but I do not how to use it. Now I know how to decode .mp3 using libmad but I want to try non-PCM wave. I just used a HEX editor to view the non-PCM wave file and I could see that the ENCODER name is vorbis.
modified on Friday, June 11, 2010 5:45 AM
|
|
|
|
|
I use CBitmapButton in a few places in my project (MFC SDI )
CBitmapButton has a function
LoadBitmaps(
LPCTSTR lpszBitmapResource,
LPCTSTR lpszBitmapResourceSel = NULL,
LPCTSTR lpszBitmapResourceFocus = NULL,
LPCTSTR lpszBitmapResourceDisabled = NULL) where lpszBitmapResource, in my case is IDB_BITMAP1 loaded from the resource file . Can u tell me how to load this bitmaps from dll(export resources) ? i know to make a dll in mfc but only to export classes with math functions Thank u very much i would be much obliged if someoane can show me
modified on Wednesday, July 7, 2010 2:34 AM
|
|
|
|
|
Member 1925990 wrote: Can u tell me how to load this bitmaps from dll(export resources) ?
There's nice tutorial here how to use CBitmapButton class.
Member 1925990 wrote: i know to make a dll in mfc but only to export classes with math function
You could start from here.
Please ask google before posting.There's plenty of tutorials how to solve these problems.
Life is a stage and we are all actors!
|
|
|
|
|
Hi all,
I want to make an animation in which I will be able to move an object 'cube' for example along given coordinate points. All the example and sample I tried were either rotating the object or translating on given points. How can we make it move on series of points ?
Any suggestion for me to start with?
Thank you in advance
Rohit
|
|
|
|
|
translate from point A and B, then from B to C, then C to D... ?
|
|
|
|
|
thank you for your reply. But I tried to do it I was not able to update the scene .. I mean I was drawing cube at each point with all previously drawn cubes. I will post code shortly.
Thank you
|
|
|
|
|
Right before drawing the new cube, redraw the old cube using the XOR value.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi, David . I am a newbie for Opengl. I have just started experimenting with it.
From information I have glTranslatef function just moves the object relative to its original position. I have never worked with opengl . So I am also unaware of many of useful functions and tricks. I am working with a code ..
#include "stdafx.h"
#include <GL/glut.h>
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
float time = 0;
float x ;
void init()
{
glClearColor(0,0,0,0);
gluOrtho2D(-5,5,-5,5);
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1,0,0);
glPushMatrix();
glRotatef(time,0,0,1);
glBegin(GL_TRIANGLES);
glVertex2f(3,-4);
glVertex2f(3.5,-3);
glVertex2f(4,-4);
glEnd();
glPopMatrix();
glColor3f(0,1,0);
glPushMatrix();
glTranslatef(x,0,0);
glBegin(GL_QUADS);
glVertex2f(-4,-4);
glVertex2f(-4,-2);
glColor3f(0,0,1);
glVertex2f(-2,-2);
glVertex2f(-2,-4);
glEnd();
glPopMatrix();
glPushMatrix();
glScalef(time/200,time/200,time/200);
glColor3f(1,0,0);
glBegin(GL_POLYGON);
glVertex2f(-2,2);
glColor3f(0,1,0);
glVertex2f(-1,3);
glColor3f(0,0,1);
glVertex2f(0,2);
glColor3f(1,0,1);
glVertex2f(-0.5,0);
glColor3f(1,1,0);
glVertex2f(-1.5,0);
glEnd();
glPopMatrix();
glFlush();
glutPostRedisplay();
}
void idle()
{ int sum = 0;
ifstream inFile;
inFile.open("C:\\Users\\RoBa\\Desktop\\test.txt");
while (inFile >> time)
{
x = time + x;
}
inFile.close();
}
void main(int argc, char ** argv)
{
glutInit(&argc, argv);
glutInitWindowSize(800,600);
glutInitWindowPosition(10,50);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutCreateWindow("Lesson 3");
init();
glutDisplayFunc(display);
glutIdleFunc(idle);
glutMainLoop();
}
test.txt is a file in which i have written many float values . Now I am trying to write code so that objects (rectangle for instance) will trace these points with changing 'x' coordinate with other coordinates constant.
Thank you in advance for help !
Rohit
|
|
|
|
|
After studying glTranslatef() function I have made few modifications in the code as..
<code>
// prayatnaopengl2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <GL/glut.h>//include our glut library
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
float time = 0;//(NEW) variable to record the how much time has passed
float x ;
void init()
{
glClearColor(0,0,0,0);
gluOrtho2D(-5,5,-5,5);//Setup our viewing area
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
//////////////////////////////////////////////////////////////////////////////////
float diff = 0;
//float x;
ifstream inFile;
inFile.open("C:\\Users\\RoBa\\Desktop\\test.txt");
while (inFile >> x)
{
//sum = sum + x;
if (x>0)
{
diff = x - diff;
diff = x;
glTranslatef(diff,0,0);
glutSolidCube(1.0f);
glutPostRedisplay();
}
else
{
diff = x + diff;
diff = -x;
glTranslatef(diff,0,0);
glutSolidCube(1.0f);
glutPostRedisplay();
}
}
inFile.close();
glFlush();
glutPostRedisplay();//refresh the screen
}
void main(int argc, char ** argv)
{
glutInit(&argc, argv);
glutInitWindowSize(800,600);
glutInitWindowPosition(10,50);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutCreateWindow("Lesson 3");
init();
glutDisplayFunc(display);
//glutIdleFunc(idle);//(NEW) calls our idle function
glutMainLoop();
}
</code>
Can this be a method for animation? I am trying to use such kind of animation for real time animation project . A code is been created which gives coordinates and I want to move object on those points.
Thank you in advance
Rohit
|
|
|
|
|
Hi David I have stopped using gluTranslatef() now I am working with glLookAt(). I read coordinates from the text file and assign those to glLookAt() function. I know my code to read the coordinates is working fine but I cant see my camera moving on those points . "Rather my computer shows a transparent window " What can be possible reason for that ? I am not getting why this happens I doubt it's because less graphic capability ...
But when I give a general for() loop to change z coordinate just to test It Works fine
I don't know how to make it work. Can you help me to solve this issue ?!
I am posting my code
#include <math.h>
#include <GL/glut.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <time.h>
#include <dos.h>
#include <windows.h>
using namespace std;
float angle=0.0,deltaAngle = 0.0,ratio;
float x=0.0f,y=1.75f,z=5.0f;
float lx=0.0f,ly=0.0f,lz=-1.0f;
GLint snowman_display_list;
int deltaMove = 0;
float a = 0.0f;
int b = 0;
void changeSize(int w, int h)
{
if(h == 0)
h = 1;
ratio = 1.0f * w / h;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0, 0, w, h);
gluPerspective(45,ratio,1,1000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void renderScene(void)
{
FILE *file;
float numbers[3];
float rx,ry,rz;
int i;
file = fopen("C:\\Users\\RoBa\\Desktop\\test.txt", "r");
while(feof(file)== NULL)
{
fscanf(file, "%f %f %f ", &numbers[b],&numbers[b+1], &numbers[b+2]);
rx = (numbers[b])/10;
ry = (numbers[b+1])/10;
rz = (numbers[b+2])/10;
cout<<rx<<endl;
cout<<ry<<endl;
cout<<rz<<endl;
glLoadIdentity();
gluLookAt(rx , ry , rz , 0.0f,0.0f,0.f,0.0f,1.0f,0.0f);
}
fclose(file);
cout<<rx<<endl;
cout<<ry<<endl;
cout<<rz<<endl;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutWireCube(2.0f);
glutSwapBuffers();
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(640,360);
glutCreateWindow("My animation");
glutDisplayFunc(renderScene);
glutReshapeFunc(changeSize);
glutMainLoop();
return(0);
}
Thank you
Rohit
|
|
|
|
|
Is there any code review tool for VC++?
|
|
|
|
|
Not sure what you mean by a "Code review tool" but generally I find a text editor, eyeballs and a knowledge of the idioms of the programming language handy.
Do you want something like lint that does a static analysis of the code? If so then have a look at PC-Lint and, if you really have to run it from inside Visual Studio, Visual Lint (IIRC) from Riverblade software.
Cheers,
Ash
modified on Thursday, June 10, 2010 8:34 AM
|
|
|
|
|
the typical tool is something that can do a batch 'diff'. something like BeyondCompare.
|
|
|
|
|
Static code analysis Tools:
http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page
http://www.campwoodsw.com/sourcemonitor.html
http://www.gimpel.com/html/pcl.htm
--
"Programming is an art that fights back!"
modified on Thursday, June 10, 2010 12:16 PM
|
|
|
|
|
Reviewboard isn't too bad for the price...
Days spent at sea are not deducted from one's alloted span - Phoenician proverb
|
|
|
|
|
I am working in open gl and i have drawn balls.I want to load the texture on them and i know how to use texturing butr the actual problem is that i donot know which coordinates should i give in glTexcoord() function so that it is exactly mapped on to ball.I am sending the source code.
<br />
<code>
//#include <GL/gl.h>
#include <windows.h>
#include <glut.h>
//#include <stdio.h>
#include <math.h>
//#include <iostream.h>
float pi=180;
const float DEG2RAD = 3.14159/180;
// Initial square position and size
GLfloat x[5];
GLfloat y[5];
GLfloat rsize = 25;
// Step size in x and y directions
// (number of pixels to move each time)
GLfloat xstep[5];
GLfloat ystep[5];
// Keep track of windows changing width and height
GLfloat windowWidth;
GLfloat windowHeight;
void drawEllipse(float xradius, float yradius,float h,float k)
{
glBegin(GL_POLYGON);
for (int i=0; i < 360; i++)
{
glColor3f(0.0f, 0.0f, 1.0f);
//convert degrees into radians
float degInRad = i*DEG2RAD;
glVertex2f(cos(degInRad)*xradius+h,sin(degInRad)*yradius+k);
}
glBegin(GL_TRIANGLE_FAN);
for ( i=0; i < 360; i++)
{
//convert degrees into radians
float degInRad = i*DEG2RAD;
glColor3f(1,1,1);
glVertex2f(cos(degInRad)*xradius+h,sin(degInRad)*yradius+k);
}
glEnd();
}
///////////////////////////////////////////////////////////
// Called to draw scene
void RenderScene(void)
{
// Clear the window with current clearing color
glClear(GL_COLOR_BUFFER_BIT);
// Set current drawing color to red
// R G B
// Draw a filled rectangle with current color
for(int i=0;i<5;i++)
{
drawEllipse(20, 20,x[i]+rsize,y[i] - rsize);
//glRectf(x[i], y[i], x[i] + rsize, y[i] - rsize);
}
//glColor3f(1.0f, 1.0f, 0.0f);
//glRectf(x[1], y[1], x[1] + rsize, y[1] - rsize);
// Flush drawing commands and swap
glutSwapBuffers();
}
///////////////////////////////////////////////////////////
// Called by GLUT library when idle (window not being
// resized or moved)
void TimerFunction(int value)
{
for(int i=0;i<5;i++)
{
// Reverse direction when you reach left or right edge
if(x[0] > windowWidth-rsize || x[0] < -windowWidth)
xstep[i] = -xstep[i];
// Reverse direction when you reach top or bottom edge
if(y[i] > windowHeight || y[i] < -windowHeight + rsize)
ystep[i] = -ystep[i];
// Actually move the square
x [i]+= xstep[i];
y[i] += ystep[i];
// Check bounds. This is in case the window is made
// smaller while the rectangle is bouncing and the
// rectangle suddenly finds itself outside the new
// clipping volume
if(x[i] > (windowWidth-rsize + xstep[i]))
x[i] = windowWidth-rsize-1;
else if(x[i] < -(windowWidth + xstep[i]))
x[i] = -windowWidth -1;
if(y[i] > (windowHeight + ystep[i]))
y [i]= windowHeight-1;
else if(y[i] < -(windowHeight - rsize + ystep[i]))
y[i] = -windowHeight + rsize - 1;
}
// Redraw the scene with new coordinates
glutPostRedisplay();//draw the scene everytime this function is called
glutTimerFunc(33,TimerFunction, 0);
//void glutTimerFunc(unsigned int msecs, void (*func)(int value), int value);
}
///////////////////////////////////////////////////////////
// Setup the rendering state
void SetupRC(void)
{
int a=0,b=0;
// Set clear color to blue
glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
for(int i=0;i<5;i++)
{
xstep[i]=1.0;
ystep[i]=1.0;
}
x[0]=0;
y[0]=0;
x[1]=-30;
y[1]=-30;
x[2]=-40;
y[2]=40;
x[3]=50;
x[3]=-30;
x[4]=-6;
y[4]=75;
}
///////////////////////////////////////////////////////////
// Called by GLUT library when the window has chanaged size
void ChangeSize(int w, int h)
{
GLfloat aspectRatio;
// Prevent a divide by zero
if(h == 0)
h = 1;
// Set Viewport to window dimensions
glViewport(0, 0, w, h);
// Reset coordinate system
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// Establish clipping volume (left, right, bottom, top, near, far)
aspectRatio = (GLfloat)w / (GLfloat)h;
if (w <= h)
{
windowWidth = 100;
windowHeight = 100 / aspectRatio;
glOrtho (-100.0, 100.0, -windowHeight, windowHeight, 1.0, -1.0);
}
else
{
windowWidth = 100 * aspectRatio;
windowHeight = 100;
glOrtho (-windowWidth, windowWidth, -100.0, 100.0, 1.0, -1.0);
}
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
///////////////////////////////////////////////////////////
// Main program entry point
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowSize(800,600);
glutCreateWindow("Bounce");
glutDisplayFunc(RenderScene);
glutReshapeFunc(ChangeSize);
glutTimerFunc(33, TimerFunction, 1);
SetupRC();
glutMainLoop();
return 0;
}
|
|
|
|
|
It appears that you are setting the color of every vertex of the triangle fan and letting OpenGL determine the colors of the pixels inside the triangles. I think that's the right way to do it but you probably don't want to use white for the color. You will be unable to see most shading effects if you do.
For texture mapping you define the [u,v] coordinates on the texture that each vertex maps to and this requires some computation on your part. There are many different algorithms for this and the one to use depends on how the texture image was "unwrapped" from the sphere. This is the same problem faced by cartographers when they draw maps of planets. They have to unwrap the surface of the sphere onto a 2D image. In your case you need to know how that was done so that you can reverse the process.
BTW - [u,v] refers to the (x,y) coordinate in the image that is used for a pixel's color.
|
|
|
|
|
I have a win32 api program which will fetch text from a server and will display it in a multiline text box.
The information is not saved using this program but it just fetch the information to display it for the user.
I give the users an html GUI to save information in UTF.
the html interface is working well like saving Western European characters.
When i display it in the text box i get two junk letter instead of the actual Latin alphabet.
How do i notify or stylize the text box to display extended characters (latin) ???
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Is your application being compiled for UNICODE? Check under General Properties for the project. If yes then it should handle Unicode characters automatically. If No then you will need to provide conversion between Unicode and MBCS.
It's time for a new signature.
|
|
|
|
|
Sorry i have replied very late.
Yes. I have defined the UNICODE and _UNICODE directives.
I have to mention here that i am using DEV C++ IDE (gnu gcc compiler collection).
The problem is with this IDE and not vc6.0.
In VC6.0 the text boxes are not even accepting unicode chars. Where as when i compiled with DEV c++ ide... the only problem is displaying it as unicode but the text boxes accepts unicode and i can directly type in the unicode strings in message boxes. I tested the message box by directly giving the strings. it worked.
Since DEV c++ is not used by people here i have to find it of my own...
I followed MS document to use unicode in VC6.0 but i cannot save unicode static text in string tables.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
VC6.0 is very old now, we have gone through 2002/3 - 2005 - 2008 and are now on 2010. I would suggest that if possible you upgrade to VS2010. If it's a question of cost then you can get the free Express Editions[^] from Microsoft.
It's time for a new signature.
|
|
|
|
|
Yes. I am in parallel creating the same application in C# because i cannot do many things in VC6.0 like unicode and SSL(for my socket programs). But i thought i can know the core of windows if i am sticking to VC6.0. I dont know mfc i want to be good in win32 API programming. I hope this can be done in .NET too... It should be. Thank you.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Jayapal Chandran wrote: I dont know mfc i want to be good in win32 API programming.
Then I suggest you follow my previous recommendation and get a copy of the free VS 2010 Express Edition C++ system, which will help you learn all about Win32 programming without any requirement to learn MFC.
It's time for a new signature.
|
|
|
|
|