Activity for javaFlacEncoder

  • Muhammad Moemin Ali Muhammad Moemin Ali posted a comment on discussion Help

    I confirm that the update fixed the bugs.

  • Preston Lacey Preston Lacey posted a comment on discussion Help

    I just posted an update that should fix these two bugs.

  • javaFlacEncoder javaFlacEncoder released /javaFlacEncoder-0.3.2-all.tar.gz

  • Preston Lacey Preston Lacey posted a comment on discussion Help

    I've been looking at that section of code and I think I found the bug. There's an unchecked access on a potentially null object in the method samplesAvailableToEncode(). If it happens that the number of samples added up to the point you call samplesAvailableToEncode() is a perfect multiple of the block-size used by the encoder, it should trigger the exception(or if no samples were ever added). I'll create a test case and verify this later tonight. Hopefully I will get the update posted tomorrow to...

  • Muhammad Moemin Ali Muhammad Moemin Ali posted a comment on discussion Help

    Version is 0.3.1 , 16-bit mono. I reproduced these errors on the following sampling rates: 48 kHz, 44.1 kHz, 32 kHz, 22.05 kHz, 16 kHz. 11.025 kHz. Haven't seen it on 8 kHz till now.

  • Preston Lacey Preston Lacey posted a comment on discussion Help

    I haven't seen that before but it sounds like an internal bug in the flac library. I'll check it out. In the meantime, can you tell me the conditions of the failure(which javaFlacEncoder version, encode settings used, is this still 16-bit mono as above?)

  • Muhammad Moemin Ali Muhammad Moemin Ali modified a comment on discussion Help

    Hi, sometimes while closing the stream and finalizing using flacEncoder.encodeSamples(flacEncoder.samplesAvailableToEncode(), true); This Fatal Exception is thrown java.lang.NullPointerException: Attempt to read from field 'int javaFlacEncoder.BlockEncodeRequest.count' on a null object reference at javaFlacEncoder.FLACEncoder.samplesAvailableToEncode(FLACEncoder.java:681) This happens sometimes and not all the times. What can I do to properly finalize?

  • Muhammad Moemin Ali Muhammad Moemin Ali modified a comment on discussion Help

    Hi, sometimes while closing the stream and finalizing using flacEncoder.encodeSamples(flacEncoder.samplesAvailableToEncode(), true); This Fatal Exception is thrown java.lang.NullPointerException: Attempt to read from field 'int javaFlacEncoder.BlockEncodeRequest.count' on a null object reference at javaFlacEncoder.FLACEncoder.samplesAvailableToEncode(FLACEncoder.java:681) This happens sometimes and not all the times. What can I do to properly finalize? Edit: Problem solved

  • Muhammad Moemin Ali Muhammad Moemin Ali posted a comment on discussion Help

    Hi, sometimes while closing the stream and finalizing using flacEncoder.encodeSamples(flacEncoder.samplesAvailableToEncode(), true); This Fatal Exception is thrown java.lang.NullPointerException: Attempt to read from field 'int javaFlacEncoder.BlockEncodeRequest.count' on a null object reference at javaFlacEncoder.FLACEncoder.samplesAvailableToEncode(FLACEncoder.java:681) This happens sometimes and not all the times. What can I do to properly finalize?

  • Muhammad Moemin Ali Muhammad Moemin Ali posted a comment on discussion Help

    I have fixed my problem. I had imported javaFlacEncoder source code and not the jar file. So, I deleted the source code and imported the jar file as a library. Before this, my code was failing everytime on all occassions but now it is encoding properly and producing good files that are seekable and have a known length. I will be waiting for the update though.

  • Preston Lacey Preston Lacey posted a comment on discussion Help

    Interesting. The header for the #277 file is properly finalized, while the header for #388 is not. Does your code only occasionaly fail to produce a proper file now, or always fail? For example, did the run that verified the two values were equal also produce a good file, or a bad file? My point is I'm curious if something is only occasionally interrupting that code before it reaches the point of finalizing the header. I did check the library source though, and there is indeed a bug that might cause...

  • Muhammad Moemin Ali Muhammad Moemin Ali posted a comment on discussion Help

    I just checked the value returned by '"flacEncoder.samplesAvailableToEncode()" and "flacEncoder.encodeSamples(flacEncoder.samplesAvailableToEncode(), true);" are the same. I check again the value of '"flacEncoder.samplesAvailableToEncode()" and it is equal to 0. I am using (int buffer.length) to give sample count parameter and not numRead. I have attached a recording that was recorded a while back from the same source code. I haven't changed anything in the source code that I know of. This recording...

  • Preston Lacey Preston Lacey posted a comment on discussion Help

    I'm not actually certain at the moment what might be the problem. It sounds like the FLAC stream is not being finalized by the line, "flacEncoder.encodeSamples(flacEncoder.samplesAvailableToEncode(), true)" When the flac stream is finalized, various details needed for seeking(including length of stream and min/max encoded frame size) are written to the front of the stream if possible(this step will be ignored if the stream isn't seekable, but yours should be since you're writing to a file). First...

  • Muhammad Moemin Ali Muhammad Moemin Ali posted a comment on discussion Help

    Hi, FlacEncoder worked before but now it is not working properly. Some media players are unable to play the recording and the others that play do not display duration and provide seek options. Java code and the recording is attached. Can you tell me where is the problem? boolean isRecording = false; private void startRecording() { FLACEncoder flacEncoder = new FLACEncoder(); StreamConfiguration streamConfiguration = new StreamConfiguration(); streamConfiguration.setBitsPerSample(16); streamConfiguration.setChannelCount(1);...

  • Preston Lacey Preston Lacey posted a comment on discussion Help

    Unfortunately, there's not a built-in way to properly append new data directly to a previously saved file using this encoder. Information about the encoded data(md5-hash, length, number of frames, etc) is kept while encoding, and this information is written out to the header space of the FLAC stream when the stream is closed. Currently, there is no method of restoring the encoder state necessary to write a proper header to the existing stream if appending new data.

  • Muhammad Moemin Ali Muhammad Moemin Ali posted a comment on discussion Help

    I have another question, how can I resume recording at the end of a previously saved flac file. When I try to add encoded data at the end of previously saved flac file, the recording resumes but there is an audible gap in between when the last recording was stopped and then resumed. What is the correct way to do this in javaFlacEncoder? Thanks

  • Muhammad Moemin Ali Muhammad Moemin Ali modified a comment on discussion Help

    Hi, I did what you said and now I am able to successfully record in flac format. Thanks very much for the help!

  • Muhammad Moemin Ali Muhammad Moemin Ali modified a comment on discussion Help

    Hi, I did what you said and now I am able to successfully record in flac format but only when the sampling rate is less than or equal to 16kHz. When the sampling rate is set to be greater than 16kHz the recording is glitchy. Below is the code I am using to record in mono but is glitchy because the sampling rate is 32kHz bufferSize = (2 * (AudioRecord.getMinBufferSize(32000, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT))); FLACEncoder flacEncoder = new FLACEncoder(); StreamConfiguration...

  • Muhammad Moemin Ali Muhammad Moemin Ali posted a comment on discussion Help

    Hi, I did what you said and now I am able to successfully record in flac format but only when the sampling rate is less than or equal to 16kHz. When the sampling rate is set to be greater than 16kHz the recording is glitchy. Below is the code I am using to record in mono but is glitchy because the sampling rate is 32kHz bufferSize = (2 * (AudioRecord.getMinBufferSize(32000, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT))); FLACEncoder flacEncoder = new FLACEncoder(); StreamConfiguration...

  • Preston Lacey Preston Lacey posted a comment on discussion Help

    Greetings! I can't be certain without more information on your source format and how you're reading them from the AudioRecord instance, but It looks like your problem will be with the source format conversion to int. If you're reading 16-bit PCM from the AudioRecord object, make sure you're reading those into a short[] and not a byte[] https://developer.android.com/reference/android/media/AudioRecord.html#read(short[],%20int,%20int) If you use a byte[] for 16-bit(which is deprecated but should work),...

  • Muhammad Moemin Ali Muhammad Moemin Ali modified a comment on discussion Help

    Hi, I am using android to capture audio from phone's microphone via android's AudioRecord class. This gives me raw pcm data in an byte[] array. I then convert the byte[] array to int[] array. I am then using this code to encode the pcm data to flac but I get noise only. FLACEncoder flacEncoder = new FLACEncoder(); StreamConfiguration streamConfiguration = new StreamConfiguration(); streamConfiguration.setBitsPerSample(16); streamConfiguration.setChannelCount(1); streamConfiguration.setSampleRate(32000);...

  • Muhammad Moemin Ali Muhammad Moemin Ali posted a comment on discussion Help

    Hi, I am using android to capture audio from phone's microphone via android's AudioRecord class. This gives me raw pcm data in an byte[] array. I then convert the byte[] array to int[] array. I am then using this code to encode the pcm data to flac but I get noise only. FLACEncoder flacEncoder = new FLACEncoder(); StreamConfiguration streamConfiguration = new StreamConfiguration(); streamConfiguration.setBitsPerSample(16); streamConfiguration.setChannelCount(1); streamConfiguration.setSampleRate(RECORDER_SAMPLERATE);...

  • contactcenterdeveloper contactcenterdeveloper posted a comment on discussion Help

    Thank you, your suggestions worked :-)

  • Preston Lacey Preston Lacey posted a comment on discussion Help

    Excellent, glad to hear it's working for you. You should be able to do the conversion...

  • contactcenterdeveloper contactcenterdeveloper posted a comment on discussion Help

    That was it! Thank you so much! I am now getting the proper coverted speech. If you...

  • Preston Lacey Preston Lacey posted a comment on discussion Help

    Greetings Check out this thread first, and see if it's the same issue with mu-law...

  • sidjain sidjain posted a comment on discussion Help

    Hello I am using JavaFlacEncoder with JRE1.7 to encode a PCM 8bit 8KHz Mono wav file...

  • craig jackson craig jackson posted a comment on discussion Open Discussion

    Hi, Hope you don't mind, but I put this project onto github to make collaboration...

  • stein stein posted a comment on discussion Help

    Hi Preston, I guess you already knows that current implementation depends on javax.sound.sampled...

  • stein stein posted a comment on discussion Help

    Hi Will, can you share your source code with me? Thanks

  • Preston Lacey Preston Lacey posted a comment on discussion Help

    Actually, I told you a bit wrong. The sample rate and sample size will be reset to...

  • Preston Lacey Preston Lacey posted a comment on discussion Help

    Hello. Does the POST response include any error details that may help? If not, the...

  • Goringo Goringo modified a comment on discussion Help

    Hello. I am trying to do a little thing for practice. So, I'm trying to send POST...

  • Goringo Goringo posted a comment on discussion Help

    Hello. I am trying to do a little thing for practice. So, I'm trying to send POST...

1
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.