Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. audio record
    Log in to post

    • UNSOLVED Sample sizes in Qt audio example
      General and Desktop • audio audio device audio waveform audio recording audio record • • Rasva  

      5
      0
      Votes
      5
      Posts
      340
      Views

      Thank you for your help, I've probably identified the problem - one of the input parameters was a char (8 bit). I've tried to fix it using the following code to reformat it so that it can be used properly for 16 bit but I keep getting the same problem /* Function with char as one of the parameters - qint64 XYSeriesIODevice::writeData(const char *data, qint64 maxSize) - same as in the Qt audio example**/ int bitsPerSample = 16; int bytesPerSample = (bitsPerSample / BITS_IN_BYTE); int signalLength = (strlen(data) ) / numChannels / bytesPerSample; short* signal = (short*)malloc(sizeof(short) * signalLength); for(int i = 0; i < signalLength; i++){ int index = i * numChannels * bytesPerSample; memcpy(&signal[i], &data[index], sizeof(short)); } Any suggestions?
    • UNSOLVED Audio widget to record and save
      Tools • audio audio record audio file save recorder widget • • Priyank_  

      2
      0
      Votes
      2
      Posts
      818
      Views

      Hi, Take a look the QAudioInput example.