User Profile

Collapse

Profile Sidebar

Collapse
shanakard
shanakard
Last Activity: Aug 28 '07, 09:50 PM
Joined: May 21 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • i tried to encode some raw data to mp2. it worked but when i play the mp2 file the sound plays faster. i will past the whole test code bellow so anyone can tell me why.

    what i have done is read some data from mic and encode it and write it to a file. then read the file again decode and write it to another file and read that file again and playback the sound.

    Code:
    #include <unistd.h>
    #include <fcntl.h>
    ...
    See more | Go to post

    Leave a comment:


  • I actually don't understand the parameters that should be set.
    Code:
    /* put sample parameters */
    c->bit_rate = 64000;                        [B]//is this the bit rate and sample_rate of input or output?[/B]
    c->sample_rate = 44100;
    c->channels = 2;
    
    /* open it */
    if (avcodec_open(c, codec) < 0) {
        fprintf(stderr, "could not open codec\n");
        exit(1);
    }
    ...
    See more | Go to post

    Leave a comment:


  • shanakard
    started a topic how to encode raw audio into mp2 or mp3 formats
    in C

    how to encode raw audio into mp2 or mp3 formats

    i am able to read raw audio data from my mic device. i need to know how to convert the data block into mp2, mp3 or some other compressed format(it is better if it could be converted to mp3).

    i am a linux programmer (beginer :-) )

    i have found that i could use ffmpeg , libavcodec librarys to do it and there's a function called avcodec_encode_ audio() i found it here... ....

    i really appreciate if anyone...
    See more | Go to post

  • shanakard
    replied to Problem adding a object to an array
    in Java
    Code:
    public class Car{
    public static String make;
    public static String model;
    public static int year;
    public static int price;
    //Car(); constructor with parameters
    public Car(String m, String d, int y, int p) {
    make = m; ......
    U see the above code all the attributes of the class Car are "static" (i.e:- public static String make)

    the thing with static variables are...
    See more | Go to post

    Leave a comment:


  • shanakard
    replied to Arrays
    in Java
    the arrays in java rae just like the on's in c++ except they use new keyword to instensiate !!!

    (ofcorce only by the appearance. in java the type checking automatic garbage collection and overflows are still checked for arrays as well, unlike in c++)
    See more | Go to post

    Leave a comment:


  • shanakard
    replied to Problem adding a object to an array
    in Java
    Code:
    System.out.println(carShop[ i ]);
    in the above line u have given a Object of type Car to the println() function
    this will run the "println(Ob ject v)" overload of the println function and take the given parameter as a "Object" type parameter.

    when any object 'x' is given to println() function it will print the output string of the x.toString() function to the console.

    since...
    See more | Go to post

    Leave a comment:


  • shanakard
    replied to Get the tick count in java
    in Java
    I m using java 1.4 and i can't seem to find anytinig in the System class except currentTimeMill is() (this is not enough accuracy)

    and it still dosen't give me the tick count either(it would be better if i had this rather than the time in nanoseconds or so....)

    if U were talking about loadliberary and using windows api or something like that. it would be nice if i had a built in method that is os indipendent
    ...
    See more | Go to post

    Leave a comment:


  • shanakard
    started a topic Get the tick count in java
    in Java

    Get the tick count in java

    i am writing a program for string matching (for a assignment @ our campus) i want to measure the cpu tick count(or verry accurate time measurement, maybe in icro seconds or so...) to analyze running time.

    can i do this in java and f so how?
    See more | Go to post

  • anyway BIG thankX for everyone who repiled :-)
    See more | Go to post

    Leave a comment:


  • "weaknessforcat s" is right
    calling a constructor from within a constructor only creates a temporary object

    ive tried the following program and it can be confirmed
    Code:
    #include <string>
    #include <iostream.h>
    
    // make a guess at what a QCString is
    typedef std::string QCString;
    
    class Encode
    {
    public:
    	int v;
    
    	Encode(
    ...
    See more | Go to post

    Leave a comment:


  • U are write both the constructors are public, my mistake

    ThankX for the fast reply.
    What I actually wanted to do was to cerate a class 'Encode' with two constructors

    Encode(QCString * value){ .....big code in herer......}

    Encode(const char* value){ Encode(new QCString(value) ); }

    some thing like that...
    See more | Go to post

    Leave a comment:


  • that must be why i remember dowing this earlier. but it dosen't work in linux (g++)...
    See more | Go to post

    Leave a comment:


  • Calling a Overloaded constructor winthin a constructor

    I m a beginner programmer and new to this site so i m not quite sure whether this is the correct place to ask this question.

    I saw the 2 articles published here about this question but can't seem to understand it.

    i have a class like this withe some overloaded constructors


    class Abcd{
    public: //sorry for forgetting this earlier
    Abcd();
    Abcd(int
    ...
    See more | Go to post
No activity results to display
Show More
Working...