From: Damian M. <dam...@da...> - 2007-08-28 07:54:07
|
Hi again, as I explore the sound in audacity I noticed that as there is a extra data saved (about 260 ms between the samples of voice). then I saw the log output from the effect : INBUFFER LENGTH: 906 INDATA LENGTH: 5000 INOFFSET: 0 OUTOFFSET: 0 Then I noticed that there is a problem with my effect in the point of saving the data, I was saving the whole inputBuffer without noticing that the data is not filling it. Sorry for the trouble, discard the previous mail :) damencho Ken Larson wrote: > Damian - > > I've fixed the problem when the echo effect was made to be stereo. > Attached is what I committed to CVS. > > Ken > > Damian Minkov wrote: >> Hi Ken, >> >> Here it is (sorry for sending it later than promised). >> Its a NetBeans project but you could also run it from the supplied >> run.sh. It captures media from the microphone, plays it and stores it in >> a raw file. If you play the file you can hear the problem that occurs >> with the conversation. >> >> http://damencho.com/fmj/TestCapture.zip >> >> Here's what's in the project : >> 1. jmf from sip-communciator. >> 2. net.sf.fmj.media.protocol.javasound.DataSource and the needed classes >> for it from FMJ. >> The only change is I have moved the methods (convertFormat) from >> JavaSoundRenderer at the end of the DataSource source code. >> So to be sure JavaSoundRenderer is not used for now. >> 3. net.sf.fmj.media.codec.audio.RateConverter and the needed classes for >> it from FMJ >> the change here is that I have commented the two checks for the >> FrameSizeInBits for input and output format as when run with >> jmf javasound these values are not set. >> 4. net.java.sip.communicator.impl.media.codec.audio.echo.EchoEffectPlugin >> is an effect which stores the data that pass through it in a file >> mic.raw in the working directory. I listen to this as I import it in >> audacity as Signed 16 bit, Little, mono, 8000 sample rate. >> The effect just copy the input buffer int the output one. >> >> In the Code in the main class I have put some config variables with some >> comments. >> /////////////////// CONFIGURE /////////////////// >> >> // the example stays the same, but just a wav file is played >> // useful to compare the difference of the time of the played and captured media >> // when using sun or ibm rate converters >> public static boolean PLAY_FILE = false; >> >> // rate converters indexes >> public static int IBM_RATE_CONVERTER = 0; >> public static int SUN_RATE_CONVERTER = 1; >> public static int FMJ_RATE_CONVERTER = 2; >> >> // which rate converter will use >> public static int RATE_CONVERTER_TO_USE = FMJ_RATE_CONVERTER; >> >> // should we use FMJ or JMF datasource >> public static boolean FMJ_DATASOURCE = true; >> >> ///////////////////////////////////////////////// >> >> If you run the example with one of the other converter you can hear the >> difference. >> >> I hope this will help. Thanks a lot for helping out! If something is >> wrong with the example, just let me know. I'll be online. >> >> Thanks! >> damencho >> >> >> >> >> >> >> >> Ken Larson wrote: >> >>> Actually I was hoping for a simple one-file example that uses a >>> Processor. Perhaps the best way for me to try this is to try >>> transmitting an mp3 with RTP myself, using FMJ studio. >>> >>> Ken >>> >>> Damian Minkov wrote: >>> >>>> Hi, >>>> >>>> I'm testing it with sip-communicator. I call a sip number in asterisk >>>> playing an mp3 and sending it to ulaw. >>>> playing it on the speakers and the rate conversation is after its >>>> captured from the microphone. >>>> Do you want to send you the changes I have made in sip-communicator so >>>> you can run this on your machine ? >>>> >>>> damencho >>>> >>>> >>>> Ken Larson wrote: >>>> >>>> >>>>> Damian - >>>>> >>>>> Do you have a sample program, and a sample media file i can use to >>>>> test this? >>>>> >>>>> Thanks, >>>>> >>>>> Ken >>>>> >>>>> Damian Minkov wrote: >>>>> >>>>> >>>>>> Hi, >>>>>> >>>>>> I am trying to use fmj RateConverter but it dosn't work. >>>>>> I remove sun and ibm ones so they are no more available as plugins >>>>>> and add the fmj one. but the captured media is scrambled. (I've >>>>>> attached some part of the raw captured media). >>>>>> >>>>>> and here is the log I've put in the process method for the conversation. >>>>>> >>>>>> [java] 18:32:55.380 INFO: fmj.process() fmj numChanged 2 >>>>>> from: LINEAR, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, >>>>>> 88200.0 frame rate, FrameSize=32 bits >>>>>> to: LINEAR, 8000.0 Hz, 16-bit, Mono, LittleEndian, Signed, 8000.0 >>>>>> frame rate, FrameSize=16 bits >>>>>> >>>>>> thanks :) >>>>>> damencho >>>>>> >>>>>> >>>>>> Ken Larson wrote: >>>>>> >>>>>> >>>>>>> See what formats are being returned from >>>>>>> >>>>>>> net.sf.fmj.media.protocol.javasound.DataSource.querySupportedFormats >>>>>>> >>>>>>> Ken >>>>>>> >>>>>>> Damian Minkov wrote: >>>>>>> >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I'm trying to force capture with the same samplerate as the >>>>>>>> incoming stream (LINEAR, 8000.0 Hz, 16-bit, Mono, LittleEndian, >>>>>>>> Signed) so the resampling to be skipped, but with no luck :( >>>>>>>> >>>>>>>> damencho >>>>>>>> >>>>>>>> Ken Larson wrote: >>>>>>>> >>>>>>>> >>>>>>>>> Damian - >>>>>>>>> >>>>>>>>> The FMJ one can actually make multiple conversions. It used to >>>>>>>>> only do one at a time when I was testing it. >>>>>>>>> (ONLY_CHANGE_1_PARAMETER false). >>>>>>>>> >>>>>>>>> However, the main drawback to the FMJ one is that it doesn't do >>>>>>>>> any interpolation or anything to optimize audio quality when >>>>>>>>> resampling. >>>>>>>>> >>>>>>>>> Ken >>>>>>>>> >>>>>>>>> >>>>>>>>> Damian Minkov wrote: >>>>>>>>> >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> thanks. I found that actually is used >>>>>>>>>> com.ibm.media.codec.audio.rc.RCModule. >>>>>>>>>> I've tried to use the fmj one (as compiling it under ibm package >>>>>>>>>> with the same name) but I saw that >>>>>>>>>> fmj.media.codec.audio.RateConverter can make one conversation at >>>>>>>>>> a time which may be the reason for not using it then >>>>>>>>>> jmf switches to com.sun.media.codec.audio.rc.RateCnvt and the >>>>>>>>>> sound quality is much much better but still has the problem with >>>>>>>>>> the time differs if you put both raw streams captured from mic >>>>>>>>>> and speaker in audacity you can see in the graph that after 20 >>>>>>>>>> seconds the stream has difference in about 20 ms. Which is much >>>>>>>>>> better then when the ibm's one is used. >>>>>>>>>> >>>>>>>>>> damencho >>>>>>>>>> >>>>>>>>>> Ken Larson wrote: >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> Damian - >>>>>>>>>>> >>>>>>>>>>> This would normally be done by a rate conversion codec. >>>>>>>>>>> >>>>>>>>>>> In FMJ, this would be net.sf.fmj.media.codec.audio.RateConverter >>>>>>>>>>> In JMF, this would be com.sun.media.codec.audio.rc.RateCnvt >>>>>>>>>>> >>>>>>>>>>> Ken >>>>>>>>>>> >>>>>>>>>>> Damian Minkov wrote: >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> Hi Ken, >>>>>>>>>>>> >>>>>>>>>>>> I have successfully run FMJ JavasoundDatasource and the problem >>>>>>>>>>>> in my tests is the same as the jmf one. Now I think that the >>>>>>>>>>>> real problem is the resampling the media, as I recorded the >>>>>>>>>>>> media coming from the mic directly from the datasource (44100) >>>>>>>>>>>> and the media is ok. but the media captured in the Effect(8000) >>>>>>>>>>>> has problems. I saw a mail on this case in jmf mailinglist but >>>>>>>>>>>> no answers there. >>>>>>>>>>>> http://archives.java.sun.com/cgi-bin/wa?A2=ind0106&L=jmf-interest&P=9775 >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> Do you know where, in which class is done the resampling? Thanks >>>>>>>>>>>> >>>>>>>>>>>> damencho >>>>>>>>>>>> >>>>>>>>>>>> Ken Larson wrote: >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>>> Damian - >>>>>>>>>>>>> >>>>>>>>>>>>> I honestly hadn't tested the javasound datasource much, so I >>>>>>>>>>>>> had a closer look and fixed a number of problems, the main one >>>>>>>>>>>>> being that it was not calling the buffer transfer handler, as >>>>>>>>>>>>> you observed. >>>>>>>>>>>>> >>>>>>>>>>>>> See if it works better now, >>>>>>>>>>>>> >>>>>>>>>>>>> Ken >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>> >>>>>>>> >>>>>> >>>>>> >>>> ------------------------------------------------------------------------- >>>> This SF.net email is sponsored by: Splunk Inc. >>>> Still grepping through log files to find problems? Stop. >>>> Now Search log events and configuration files using AJAX and a browser. >>>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>>> _______________________________________________ >>>> Fmj-devel mailing list >>>> Fmj...@li... >>>> https://lists.sourceforge.net/lists/listinfo/fmj-devel >>>> >>>> >>>> >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> Fmj-devel mailing list >> Fmj...@li... >> https://lists.sourceforge.net/lists/listinfo/fmj-devel >> >> |