How read (audio) wav file?

Hello.

I'm new environment BB devlopement.

I want to play a wav file, click the button or o\any another event in the context of application.

How can I do these things, I train with the following code, but I get the null reference.

I'm sure I have wav (audio) file in my resources folder and I also know that my file name is currect, but I can't

why I get this problem...?

public void PlaySound (String filename)
{
try {}
InputStream inptstrm is getClass () .getResourceAsStream (filename);.
myPlayer = Manager.createPlayer (inptstrm, "wav");
myPlayer.Realize ();
myPlayer.prefetch ();
VC = (VolumeControl) myplayer.getControl ("VolumeControl");
vc.setLevel (20);
myPlayer.Start ();
}
catch (Exception e) {}
Richtxbx.setText ("Error:" + e.getMessage () m:System.NET.SocketAddress.ToString ());
}
}

Thank you

Try this

 Player myplayer = javax.microedition.media.Manager.createPlayer(inptstrm,"audio/x-wav");
                                        myplayer .realize();
                                        myplayer .start();

Tags: BlackBerry Developers

Similar Questions

  • How read datalog multiple files at the same time?

    Hello friends...

    can someone help me to show how read datalog multiple files at the same time?

    Here is the example of my case.

    I have 500 files in a folder. each file contains a waveform and its setting.

    and then I want to do a card spectral these files, because these files have been saved in the order.

    the point is to know how to read these 500 files at once? I made a program to read these files, but the program can read these files in one by one. So it is very uncomfortable to read 500 files one by one. can someone help me solve this problem? Thank you. I hope you can show me the program. Thank you again...

    Hi jojo,

    Well, in the range of functions daughter, you will find a function to list the contents of the folder. This allows to get the names of all the files datalog, and then use a loop FOR to read.

    No one is obliged to provide 500 names of files manually - that's why we use a programming language to let the computer do the stupid work

  • BlackBerry smartphones can not read the wav file

    I have the Storm 9530 w / v4.7.0.148 (Platform 4.0.0.181) installed. When I try to read an attachment wav file, I get the message "this type of attachment cannot be seen on the device. I have the bb installed v4.7.0 service attachment. Can someone please help with troubleshooting so I can play wav attachments?

    Thanks - Terrie

    I forwarded the email with wav attachment to my e-mail host who also comes from my Storm. I was able to open and read this attachment wav file. I can play now also the attachment of my account to work on the storm. Not 100% sure that solved the problem, but it works now!

  • Read the wav file

    Hi all

    is it possible to play a wav file and then treat it?

    Thank you

    I give an example that might, greetings

  • ICM VRU Script - unable to read certain .wav files

    Hi guys,.

    I'm under CVP microapp to play multimedia files, the name of the VRU (PM, message, S) script. However, only some .wav files are played. When I change the 'message' to another file wav wav file IE. those provided by my instructor, it works.

    When I tried to record a speech or to convert a sound file in .wav format and store in my media server, it would not play and causes my IP communicator crashing.

    Please advise, appreciate your help.

    Concerning

    Hello

    in technical terms, it is not only the G.711 uLaw, but certainly not PCM. You can try uLaw, aLaw or G.729r8.

    G.

  • How to make Wav files which is 352 Kbps (mono) 1 16-bit 22.05 kHz?

    I use Adobe Audition 3.0

    I need to export a Wav file:

    22.05 kHz 352 kbit/s of data rate channel

    1 (Mono) channel 16-bit sample size

    I could not find the data rate 352 kbit/s the four options while trying to save the wav file

    The 352 bitrate is just 16-bit 22.05 kHz (rate). So it of just the bits multiplied by the rate and really means nothing when it is applied to a .wav file.

    I would use 'Convert the Type of sample' in the Edit to convert to this format and then save the file.

  • Reset the read audio wave

    Hi all

    We are a group of students from DTU and we work with software defined radio in a 3 week course where we will be designing a radio station FM/receiver.
    We encountered a problem regarding resetting the position marker file in the sound file Read.vi. Our attempt must be a reset button which, once clicked resets the wave at 0 file marker so that the next reading occurs from the beginning of the audio file. We tried to use the absolute/relative position associated with a variety of ways to use the position of input and output offset offset, but with a bit of luck. The shift seems to be growing quickly or refuse to read the data when reset causing an underflow in our component of Tx.

    Any who would be able to provide a simple example to reset the sound file Read.vi, or is it necessary to launch a whole new instance/component?

    Thank you much in advance.


  • Great conversion or compression of audio wav files

    Audio multitrack recording. WAV Master files are about 10 MB per minute of recorded music. Cannot send files by e-mail that big. Need convert or reduce to around 5-6 MB mp3 format, or compatible.

    Audio multitrack recording. WAV Master files are about 10 MB per minute of recorded music. Cannot send files by e-mail that big. Need convert or reduce to around 5-6 MB mp3 format, or compatible.

    ======================================
    Try to convert it to WMA or MP3 using the following free software:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Koyotesoft "Free MP3 WMA Converter".
    http://www.koyotesoft.com/indexEn.html
    (FWIW if you install the converter, you can
    Uncheck offerings from Yahoo and Dealio) (also... you
    may want to uncheck the CD Ripper and the Easy
    MP3 Cutter)

    After installing the program... open and drag and drop
    your audio files on the main screen...

    Choose a backup folder (path of output). Or just leave...
    "Save to the directory the file" checked and the new
    files will be saved in the folder with the current files.

    Choose a format...

    Left, click Convert.

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • Media Player does not burn the audio (wav) files on the disk, or play "" CD error ".

    Media Player was working fine until recently. Now when I hit the button "Start burn" the burn starts momentarily, the time of the audio files is displayed, but when I insert the CD in the drive, it reads 'CD error' and there is no sound. I recently installed a new security package (Webroot) but none of my other software has been affected. Tab of computability, I noticed that it is set to windows 95 (I have windows 7), but the program does not allow me to change it. I checked for driver updates, but the computer says that all drivers are current and the device works correctly. any help would be appreciated. Thank you.

    Hi Mike,.

    I suggest you to change the settings while burning the files using Windows Media player.

    Check out the link to do so:

    http://Windows.Microsoft.com/en-us/Windows/Media-Player-CD-DVD-burning-settings#1TC=Windows-7

    For troubleshooting further, you can also follow the link suggestions:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-windows_programs/Windows-Media-Player-error-while-burning-CD-help/24026285-bebd-4b2d-beb2-77ff50b88030?page=1

    Please let us know if the problem still persists.

  • I have a problem with reading. WAV files.

    So I tried to mix these sounds to make cool music, but when I open something like Audacity, it sounds completely different when played in windows media player, I am really confused. Has it to do with codecs or bit rate or something like that? Any help is appreciated. Thank you!

    Evan,

    What is the version of Windows installed on the computer?

    Is the question limited to Audacity?

    I'd like you try to play different music files.

    In addition, I would have you read these articles.

    http://support.Microsoft.com/kb/316992#top

    http://Windows.Microsoft.com/en-us/Windows/codecs-frequently-asked-questions#codecs-frequently-asked-questions=Windows-7

    We know if that helps you.

  • How read Services.msc file.

    For some unknown reason, the folder serices.msc in the administration in the Control Panel tools wants to use Adobe Reader to open the file. Of course, it does not open. What program I need to change the 'Open with' dialog box to read? I have Windows Vista.

    Hi Pat,

    I understand that you are unable to open services.msc and when you try to open the same, it tries to open with Adobe Reader.

    Facing this problem with another program/application or tool?

    This seems to be a problem with the Windows file association that went wrong. We will try to correct this. To do this, try the following.

    • Open default programs by clicking the Start button, click default programs.
    • Click on associate a type of file or Protocol with a program.
    • In the list of available file types, find .msc and click it to select it. At the top right of the screen click Change program.
    • Click Browse and navigate to C:\Windows\System32. Scroll the list of the files (not folders) and mmc, click to select it and click Open. Click Close. See if it helps.

    For more information, take on this very useful article.

  • OBIEE 11G: How 'read' an Excel file from the file system?

    I wonder to provide a link to a page of dashboard OBIEE to read an Excel - probably open it in a new window.

    Can what method I use to provide a link to open and read a link to an excel file in a page of OBIEE dashboard?

    Thank you in advance.

    Check this link http://total-bi.com/2011/02/external-files-obiee-dashboard/

    If brand aid

    Thank you
    http://cool-bi.com

    Published by: Srini VIEREN on May 28, 2013 12:06

  • Export Audio (.wav) of my file animate

    Hello

    I can't figure out how to export just a file audio (.wav) file of the animation (animate file) I build.  The reason why I want to do it is because I have several different compiled .wav files in my file animate and I want to export the file, I work in a single .wav file.

    Your help is appreciated!

    Thank you

    Christina

    Yes, of course!

    Basically, you export video as I said, and then once this file opens in Media Encoder, you select the menu drop-down he... In my example it is H264... change now in AIFF, rendering click (the green play button) and you're golden!

  • Why MATLAB cannot read wav files OR? Mind wav compression errors.

    I write, 1-n-channel, 24-bit wav files using the standard vi OR its file Open/Close/Write (DBL) found in LabVIEW 8.6\vi.lib\sound2\lvsound2.llb. This application data are acquired from a NOR-9234 via USB-9162 or NOR-cDAQ-9172. My wav files are readable by many readers of wav, including media player file (channels 1-2), SoundForge, and my own readers of LabVIEW wav file. However, MathLab is unable to read these files, saying they cannot deal with compressed wav format. As we read in the documentation of NOR, these files are decompressed. I found a player wav to header via the discussion forums and read my wav file. The compression code that was printed was-2 instead of 1 for uncompressed. Anyone had similar problems reading in MATLAB? Someone knows something about the importance of a - 2 for compression? My guess is that there is a word size problem here that MATLAB cannot process or NOR is not properly function.

    Well, I learned a little more since last we spoke. The standard MatLab wav player is wavread.m. This script must be able to read multi channels 24 bit files; but he does not read files from LabVIEW. We find a change to this script, called wavexread.m, which was developed to read wav files that use WAVE_FORMAT_EXTENSIBLE. This format was developed by MS as an extended format to write multi channel + 24 bit files with more information included. LabVIEW wav files are readable by MatLab via the use of this script. Basically the script ignores formatting as if the compression for the PCM format setting was set to 1 (instead of-2 or, as we know it, "FEFF"). I tried rewriting the file binary wav and replaced the "FEFF" with "0100". This file is readable by the wavread.m of stock but not the wavexread.m extended; hiliting besides the fact that MatLab do not really care.

    However, I'll throw this back order to ask whether it is really necessary to use the extended format to write these files when the standard format would be sufficient. It sure would have made life much easier if my client did not need to worry about this.

    Thanks for your help.

  • WAV files will not import

    Sometimes I create an audio file to accompany an image. This audio file is written on the my camera CompactFlash memory card in a wav format. In my workflow, I insert the CF card into my computer and open LR to initiate an import of the image, as well as to rename the image using my own model (which is yyyy_mm_dd_HHmmss). Since LR1 and until a while ago 4 months this workflow worked perfectly rename both images and its associated wav file (giving both the same name) and put in the folder I designated during the import. That allowed me to use LR to see what images had attached audio files by looking at metadata field of the library module titled "Audio file" as I saw the pictures as well as read this wav file by clicking on the arrow in the Panel metadata.

    In the last months, I continued to use the stream of work preceding but noticed that, if I thought that I had created for a few images wav files, I saw more registered in the "audio". As I saw these audio files appear in the metadata Panel, I assumed that I had simply forgotten to create the files. However, recently returning a great shoot, I followed once more my usual workflow but this time, noted that I did of wav files on my CF card, but none were imported if images did import and were renamed according to my model.

    I spent the morning trying different methods to get my workflow to work as originally it did but had no luck. Ironically, I noticed that a new version of LR was available today (2016-03-31) so I installed it, but the problem has not been corrected.

    I tried procedures and their results:

    1. Import without using my custom template. Results: image is important to designated folder and is viewable in LR, but the wav file does not matter and is therefore not visible (or playable) in LR.
    2. Import without using my custom template, and THEN manually copy the wav file in the designated folder. Results: image matter refers to the folder and is viewable in LR but wav file is not listed in the metadata Panel, BUT after restart LR the image file is visible AND the wav file is listed in the metadata field (and the wav file is playable by clicking on the "arrow" in the metadata field).

    I use Windows 10 and have tried the steps above with the image and audio files created with a Nikon D3 and Nikon D3x.

    I have searched through this and other forums and cannot find a solution to allow my workflow work as it has done for years.

    I thank everyone's help.

    It also happens to me with LR CC 2015.5.  On Windows 10, import from a SD card does not matter. Sidecars WAV.  But the import from disk files import them (and they appear in the metadata panel immediately without the need to restart).

    However, on Mac OS X 10.11.4, import. Sidecars WAV works of SD cards works as expected.

    I suggest that you file a bug report in the Adobe official feedback forum: Photoshop Lightroom | Community customer Photoshop family. Include all the details that you have posted here (not just a link to this thread, because Adobe product designers are unlikely to click through).

Maybe you are looking for

  • Agilent U2722A linear voltage ramp

    I am currently writing a LABVIEW VI to interface with an Agilent U2722A. I want to measure current constantly while maximum increase of voltage of 0V to a defined use specifying the step size and no time (a linear scan of tension). I downloaded the d

  • install driver GPIB Windows 7 x 64

    I try to install the latest driver GPIB 2.7.3 for a GPIB-USB-HS on Windows 7 64 bit. The Setup is for multiple OS, including Windows 7 32-bit and 64-bit. When I try to install it, the installation program indicates (x 86) C:/Program Files /... When I

  • audio and video codecs

    I tried to watch a video, but I couldn't hear the sound, there is no clear sound. then I tried to install a codec to solve the problem and when I installed this codec, it uninstalled my default one and now when I play a video or a song, the sound is

  • Where is my option of Program Files (86) on my Windows 7 32-bit system?

    I have a version of Windows 7 Professional installed on my PC to 32-bit.  Program Files (86) is not listed as a present on my C / drive.  How can I install/activate Program Files (86)? ccough2

  • OfficeJet 6700, wireless, not IE - 10 print, prints OK from IE - 9 on the same computer. Windows 8

    I installed and run all programs HP Assistant and everything seems fine.  When I print from the 'Office' using Internet Explorer 9, it works.  When I try to print from "Metro (homepage) interface" on the same page in Internet Explorer 10 nothing prin