C++ :: MP3 Frame Header Importing
Jun 24, 2013
Code:
/* some useful headers */
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
//my headers
#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <vector>
[XCode] .....
The bit that's giving me issues is the "calculatedetails" function, where an mp3 file is opened in binary and then an array of chars is filled with the binary data.
The problem I'm having is that I want to be able to read the constituent bits of the characters in, so that I can find the mp3 frame headers (12 1's in succession)
I'm aware that the section I've added in to perform this is incorrect.
View 7 Replies
ADVERTISEMENT
May 1, 2012
I m trying to read a video frame by frame through a c program for which i need to know the format of .wmv (native video file for windows) file,can i get it??
View 6 Replies
View Related
Aug 27, 2013
i was trying to achieve a better way of game looping. so i have a game loop algrithm. but i dont think its quite good. i want it to be better.
here is my algorithm
bool quit = false;
while(quit == false) {
while(blah blah events)//here we hold events {
if(the user want to quits) {
quit = true;
[code]....
View 2 Replies
View Related
Jan 10, 2015
I want to show a frame of a gif image. I searched and found that the following code should work, but it doesn't work. it detects the number of frames correctly but it shows the whole frames of gif instead of the specified frame.
Image[] frames = new Image[36];
Image GG = Image.FromFile(@"C:UsersAdministratorTEST C#TEST2frame2chef.gif");
FrameDimension dimension = new FrameDimension(GG.FrameDimensionsList[0]);
// Number of frames
int frameCount = GG.GetFrameCount(dimension);
label1.Text = frameCount.ToString();
// Return an Image at a certain index
GG.SelectActiveFrame(dimension, 1);
frames[1] = ((Image)GG.Clone());
pictureBox1.Image = frames[1];
View 2 Replies
View Related
Dec 10, 2012
I m trying to place an image on the colour frame of the Kinect live video. I m able to overlay the image using alpha blending mechanism.
The image used is a bitmap image of dimension 128*128.
The Kinect has a resolution of 640*480.
IDE used is Visual studio 2010 and I m developing using c++.
The Kinect has a render target whose size is taken as 640*480 so that it stretches for the complete window. So when I try to overlay the image it appears 5 times because of this stretching.
If I increase the image size to 640*128 i get a single image that is stretched horizontally across the window with dimension 640*480.
I have created a function that will create a render target with bitmap properties and size equal to 640*480. This is used to store the data from the Kinect, frame by frame, and draw it on to the screen
So I think when I overlay the image, it gets replicated 5 times to meet the render target size.By default the image is placed at the left top position.
My doubts are
- How can I use different functions to specify the size of render target for Kinect as 640*480 and the size of render target for bitmap image as 128*128.
- How to I give overlay or place the image on the live video at a specific location.
View 2 Replies
View Related
Mar 13, 2013
This code will show the data from the .txt file "file1" the data is (0.0 0.1 0.2 0.5 0.8 0.9 1.0)
What I'm trying to do is take these float values and add them all up and divide them by 7 (finding the average and output that) Convert it into a percent and print it in a field:
Width of 6 with 2 digits after the decimal point...
I tried doing something like cout << "the average is: " << data/7 << endl; but that didn't work. I got an error that said "/" was not an operator.
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
ifstream myfile("file1.txt");
string data;
getline (myfile, data);
cout << data << endl;
myfile.close();
return 0;
}
View 1 Replies
View Related
Feb 22, 2015
I already have this but I sense I'm missing something so I'd like to be pointed to a proper article/document on this sorta thing.
Code:
#if defined( __GNUC__ ) || defined( __GNUP__ )
#define PP_ATTR( TYPE ) __attribute__( TYPE )
#ifndef _PRAGMA
#define _PRAGMA( COMMAND ) _Pragma( #COMMAND )
[Code] .....
View 12 Replies
View Related
Nov 21, 2013
I am trying to take a Text File mydata.txt and import it into a structure however when I try to run this code it just closes out.
Code:
#include<stdio.h>#include<stdlib.h>
#include<string.h>
#include<ctype.h>
struct hard_disk{
char name[18];
double size;
[Code] .....
View 4 Replies
View Related
Mar 13, 2013
This code will show the data from the .txt file "file1" the data is (0.0 0.1 0.2 0.5 0.8 0.9 1.0)
What I'm trying to do is take these float values and add them all up and divide them by 7 (finding the average and output that)
Convert it into a percent and print it in a field:
Width of 6 with 2 digits after the decimal point...
I tried doing something like cout << "the average is: " << data/7 << endl; but that didn't work. I got an error that said "/" was not an operator.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
ifstream myfile("file1.txt");
string data;
getline (myfile, data);
cout << data << endl;
myfile.close();
return 0;
}
View 1 Replies
View Related
Oct 2, 2012
how do I import the stripped export names (no mangling) from C code
A functions int Func()
is exported by def file to MyDll.dll
LIBRARY
EXPORTS
Func
Now if I import from another source Func by providing
exyern "C" int Func()
/lib:MyDll.lib
I get error error LNK2019: unresolved external symbol Func referenced in function main
View 1 Replies
View Related
Jul 18, 2014
what I'm trying to do is output a certain string depending on the color I see in the video feed. For right now, what I've done is threshold the feed so that everything above a certain brightness shows up as Red. Now I want to have something that says if there's any red in the feed, then I output a "1" to a text box on my user interface that's showing the feed. If there is no red, then I output a "0" to the text box.
I'm using Emgu CV C ++ with VS2010.
This is the code I have so far that isn't working correctly, it's giving me a compiler error.
cvConvertScaleAbs(frameFromCamera->Ptr.ToPointer(),frameDisplay->Ptr.ToPointer(),double(1)/16,0);
cvCvtColor(frameDisplay->Ptr.ToPointer(),frameColorDisplay->Ptr.ToPointer(),CV_GRAY2BGR);
cvThreshold(frameDisplay->Ptr.ToPointer(),maskSaturated->Ptr.ToPointer(),200,255,CV_THRESH_BINARY);
[Code] .....
and the error it's giving me
BAOTFISInterface.cpp(1010): error C2664: 'Emgu::CV::Image<TColor,TDepth> ^Emgu::CV::Image<TColor,TDepth>::InRange(Emgu::CV::Image<TColor,TDepth>
^,Emgu::CV::Image<TColor,TDepth> ^)' : cannot convert parameter 1 from 'Emgu::CV::Structure::Bgr *' to 'Emgu::CV::Image<TColor,TDepth> ^'
[Code] .....
Build FAILED.
View 1 Replies
View Related
Nov 9, 2014
Essentially what I need to do is take a text file, ("input.txt"):
4 4
1 0 0 1
1 1 1 1
0 0 1 0
0 0 1 0
And take the first two values on line 1 (4, 4) and use them as length and width.
Number of rows: 4
Number of columns: 4
Then I need to print out the matrix and further manipulate it. I need to find the sum of the 1's per column and then take that number and replace each 1 with the 1's in each column.
So it'll look like this:
2 0 0 2
2 1 3 2
0 0 3 0
0 0 3 0
The part that's mostly troubling me is that my instructor will be giving me the input file with random values, so I don't know what the matrix dimensions will be.
I can read the 2D array but can't seem to use it after. I need to find a way to skip the first line, and then read in the matrix and be able to use it mathematically to add up each column.
View 1 Replies
View Related
Mar 29, 2013
I'm trying to add a function now that lets the user open 1 or more files and import them to the database and dataGridView. Now the way it is now (should) work. But when it has finished with FILE1, it won't add FILE2 as it then gives me an error that the Column Date Already exists.
My code is below
private void btnOpenLog_Click(object sender, EventArgs e) {
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "Log Files (*.log)|*.log";
openFileDialog1.Multiselect = true;
[Code] .....
View 12 Replies
View Related
Nov 27, 2012
Change the frame window size according to font size increases.
View 3 Replies
View Related
May 16, 2014
I'm doing a compiler, and I'm using writing everything in headerfiles.
at the moment I have lexer.h, token.h and for this case I need reservedWords.h
reservedWords.h is made up of enums showing the needed words
in token.h I have a function called reservedWords reservedLookup(string str) which returns a reservedWord (enum)
now in lexer.h I have a function called Token* getNextToken() in which I need to make use of the function reservedLookup found in token.h
note that all of them are classes apart from reservedwords as in
class Lexer
{
public: .....
}
class token
{
public .....
}
how I can call that function?
I tried declaring reservedWords reservedLookup (string str) BUT obviously it's directing me as Lexer::reservedLookup and not as Token::reservedLookup
When I tried using Token::reservedLookup it gave me
E:Universitycompilerslexer.h|65|error: cannot declare member function 'Token::reservedLookup' within 'Lexer'|
N.B I use namespace std, that's why I didnot write std::string str
View 1 Replies
View Related
Mar 1, 2013
private String[] GetExcelSheetNames(string excelFile) {
OleDbConnection objConn = null;
SqlConnection objSqlConn = null;
System.Data.DataTable dt = null;
try {
[code].....
Now I can fatch all the excel sheet belongs to the Excel File.But How can I check "If and Only If the sheets are havin Underscore in their name(eg. student_data,teachers_data) then only the data of the sheets will populate in tha data base"
View 2 Replies
View Related
Sep 16, 2013
When including a header file in stdafx.h, should that file still be included in the source file where it is actually used?
If it is included in both places, is the one in the source file ignored?
View 5 Replies
View Related
Sep 28, 2013
i have 1 class:
from here: [URL]
template <typename Container, typename ValueType, void (Container::*setptr)(ValueType t),ValueType (Container::*getptr)(), int nPropType=3>
class property {
[code]....
(but i did the version 2;))
my question is: can i put these:
void setContainer(Container* cObject) {
m_cObject = cObject;
}
in header template?
i did these:
template <typename Container,Container* cObject, typename ValueType, void (Container::*setptr)(ValueType t),ValueType (Container::*getptr)(), int nPropType=3>
class property {
[Code] .....
how use it:
property <person2,this,string,&person2::setname,&person2::getname> Name;
(person2 is the class name)
errors messages:
"C:UsersJoaquimDocumentsCodeBlocks esteventsmain.cpp|31|error: invalid use of 'this' at top level|"
"C:UsersJoaquimDocumentsCodeBlocks esteventsmain.cpp|31|error: template argument 2 is invalid|"
how can i use the 'this' in template header?
View 1 Replies
View Related
Mar 23, 2013
1. Write a program the calculates the volume of a sphere.
Use a define to set Pi to 3.14 and a macro for the formula for the sphere.
V = 4/3PiR3.
In main ask for the radius (R).
Pass it to a function where you calculate the volume and return it to main and print the volume in main.
Use float values. (Save this program as you'll need it later.)
Code:
#include<stdio.h>
void fun (float);
main()
[Code].....
View 8 Replies
View Related
Nov 2, 2013
I have a piece of code in C with header files included. I run it on Mac OS X Maverick with XCode 4.6.2 installed. GCC is also installed. Note that Command Line Tools in XCode are already installed.
When I compile it, the error I receive says something like this:
add.c:1:19: error: stdio.h: No such file or directory add.c:2:20: error: stdlib.h: No such file or directory add.c:3:20: error: unistd.h: No such file or directory
However when I run it on Ubuntu, it compiles without a problem.What to do?
View 2 Replies
View Related
Dec 9, 2013
So I've been making a header file and put variables in their own namespace to avoid conflicts. My question is, do functions in the header file normally go in a namespace too, or should they just be named in a way which makes them unlikely to be accidentally copied?
View 15 Replies
View Related
May 19, 2013
Can we put using namespace std; in a header file? Someone told me not to do it, but I don't know why...
View 2 Replies
View Related
Jun 4, 2013
I need read a file with header and I wanna print the file in output. How can I do that? I tried but not work..
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
[Code]....
View 1 Replies
View Related
Jul 24, 2013
All i want to do is modify a header of a file(.exe file). I just want to do if for fun and see what I can do with it.
View 3 Replies
View Related
Apr 11, 2013
I have a class Myclass (for the sake of the example). I have a header file 'space.h', which is following:
#include "Myclass.h"
struct Files {Myclass* new_object, int number};
But turns out in the Myclass.h, I need the struct Files, like so:void function(vector<Files> arrangement);
So I would have to include "space.h" in the Myclass.h, but this way there's going to be a double definition of struct Files, since Myclass.h includes space.h and space.h includes Myclass.h.
View 4 Replies
View Related
Apr 2, 2013
My teacher talks about header files just having definitions and not declerations. I am writing a program that has a .h file and a related .cpp file along with a main.cpp it would be nice to have the .cpp file associated with the .h file compiled into an object file that would than just be referenced when the .h file is included. Am I making any sense?
View 2 Replies
View Related