Java Doc for AudioConversionTool.java in  » 6.0-JDK-Modules » java-3d » com » db » media » audio » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » com.db.media.audio 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.db.media.audio.AudioConversionTool

AudioConversionTool
public class AudioConversionTool (Code)
Useful methods for converting audio data.




Method Summary
public static  shortalaw2linear(byte ulawbyte)
    
public static  voidalaw2pcm16(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean bigEndian)
     Fills outBuffer with pcm signed 16 bit samples.
public static  voidalaw2pcm8(byte[] buffer, int byteOffset, int sampleCount, boolean signed)
     Converts an alaw buffer to 8bit pcm samples The 8bit bytes overwrite the original alaw values.
public static  voidalaw2pcm8(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean signed)
     Fills outBuffer with alaw samples.
public static  bytealaw2ulaw(byte sample)
    
public static  voidalaw2ulaw(byte[] buffer, int byteOffset, int sampleCount)
     Converts a buffer of aLaw samples to uLaw.
public static  voidalaw2ulaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)
     Fills outBuffer with ulaw samples.
public static  intbytesToInt16(byte highByte, byte lowByte)
     Converts 2 bytes to a signed integer sample with 16bit range.
public static  intbytesToInt16(byte[] buffer, int byteOffset, boolean bigEndian)
     Converts 2 successive bytes starting at byteOffset in buffer to a signed integer sample with 16bit range.
public static  intbytesToInt24(byte[] buffer, int byteOffset, boolean bigEndian)
     Converts 3 successive bytes starting at byteOffset in buffer to a signed integer sample with 24bit range.
public static  intbytesToInt32(byte[] buffer, int byteOffset, boolean bigEndian)
     Converts a 4 successive bytes starting at byteOffset in buffer to a signed 32bit integer sample.
public static  shortbytesToShort16(byte highByte, byte lowByte)
     Converts 2 bytes to a signed sample of type short.
public static  shortbytesToShort16(byte[] buffer, int byteOffset, boolean bigEndian)
     Converts 2 successive bytes starting at byteOffset in buffer to a signed sample of type short.
public static  voidchangeOrderOrSign(byte[] buffer, int nOffset, int nByteLength, int nBytesPerSample)
    
public static  voidchangeOrderOrSign(byte[] inBuffer, int nInOffset, byte[] outBuffer, int nOutOffset, int nByteLength, int nBytesPerSample)
    
public static  voidconvertSign8(byte[] buffer, int byteOffset, int sampleCount)
    
public static  voidconvertSign8(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)
    
public static  voidintToBytes16(int sample, byte[] buffer, int byteOffset, boolean bigEndian)
     Converts a 16 bit sample of type int to 2 bytes in an array.
public static  voidintToBytes24(int sample, byte[] buffer, int byteOffset, boolean bigEndian)
     Converts a 24 bit sample of type int to 3 bytes in an array.
public static  voidintToBytes32(int sample, byte[] buffer, int byteOffset, boolean bigEndian)
     Converts a 32 bit sample of type int to 4 bytes in an array.
public static  bytelinear2alaw(short pcm_val)
    
public static  bytelinear2ulaw(int sample)
     Converts a linear signed 16bit sample to a uLaw byte.
public static  voidpcm162alaw(byte[] buffer, int byteOffset, int sampleCount, boolean bigEndian)
     Converts a buffer of signed 16bit big endian samples to uLaw.
public static  voidpcm162alaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean bigEndian)
     Fills outBuffer with alaw samples.
public static  voidpcm162ulaw(byte[] buffer, int byteOffset, int sampleCount, boolean bigEndian)
     Converts a buffer of signed 16bit big endian samples to uLaw.
public static  voidpcm162ulaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean bigEndian)
     Fills outBuffer with ulaw samples.
public static  voidpcm82alaw(byte[] buffer, int byteOffset, int sampleCount, boolean signed)
     Converts a buffer of 8bit samples to alaw.
public static  voidpcm82alaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean signed)
     Fills outBuffer with alaw samples.
public static  voidpcm82ulaw(byte[] buffer, int byteOffset, int sampleCount, boolean signed)
     Converts a buffer of 8bit samples to uLaw.
public static  voidpcm82ulaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean signed)
     Fills outBuffer with ulaw samples.
public static  voidshortToBytes16(short sample, byte[] buffer, int byteOffset, boolean bigEndian)
     Converts a sample of type short to 2 bytes in an array.
public static  voidswapOrder16(byte[] buffer, int byteOffset, int sampleCount)
    
public static  voidswapOrder16(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)
    
public static  voidswapOrder24(byte[] buffer, int byteOffset, int sampleCount)
    
public static  voidswapOrder24(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)
    
public static  voidswapOrder32(byte[] buffer, int byteOffset, int sampleCount)
    
public static  voidswapOrder32(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)
    
public static  byteulaw2alaw(byte sample)
    
public static  voidulaw2alaw(byte[] buffer, int byteOffset, int sampleCount)
     Converts a buffer of uLaw samples to aLaw.
public static  voidulaw2alaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)
     Fills outBuffer with alaw samples.
public static  shortulaw2linear(byte ulawbyte)
    
public static  voidulaw2pcm16(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean bigEndian)
     Fills outBuffer with pcm signed 16 bit samples.
public static  voidulaw2pcm8(byte[] buffer, int byteOffset, int sampleCount, boolean signed)
     Inplace-conversion of a ulaw buffer to 8bit samples.
public static  voidulaw2pcm8(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean signed)
     Fills outBuffer with ulaw samples.



Method Detail
alaw2linear
public static short alaw2linear(byte ulawbyte)(Code)



alaw2pcm16
public static void alaw2pcm16(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean bigEndian)(Code)
Fills outBuffer with pcm signed 16 bit samples. reading starts from inBuffer[inByteOffset]. writing starts at outBuffer[outByteOffset]. There will be sampleCount bytes read from inBuffer; There will be sampleCount*2 bytes written to outBuffer.



alaw2pcm8
public static void alaw2pcm8(byte[] buffer, int byteOffset, int sampleCount, boolean signed)(Code)
Converts an alaw buffer to 8bit pcm samples The 8bit bytes overwrite the original alaw values. The first byte-offset of the aLaw bytes is byteOffset. It will be written sampleCount bytes.



alaw2pcm8
public static void alaw2pcm8(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean signed)(Code)
Fills outBuffer with alaw samples. reading starts from inBuffer[inByteOffset]. writing starts at outBuffer[outByteOffset]. There will be sampleCount bytes written to outBuffer.



alaw2ulaw
public static byte alaw2ulaw(byte sample)(Code)



alaw2ulaw
public static void alaw2ulaw(byte[] buffer, int byteOffset, int sampleCount)(Code)
Converts a buffer of aLaw samples to uLaw. The uLaw bytes overwrite the original aLaw values. The first byte-offset of the uLaw bytes is byteOffset. It will be written sampleCount bytes.



alaw2ulaw
public static void alaw2ulaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)(Code)
Fills outBuffer with ulaw samples. reading starts from inBuffer[inByteOffset]. writing starts at outBuffer[outByteOffset]. There will be sampleCount bytes written to outBuffer.



bytesToInt16
public static int bytesToInt16(byte highByte, byte lowByte)(Code)
Converts 2 bytes to a signed integer sample with 16bit range.

This is a reference function.




bytesToInt16
public static int bytesToInt16(byte[] buffer, int byteOffset, boolean bigEndian)(Code)
Converts 2 successive bytes starting at byteOffset in buffer to a signed integer sample with 16bit range.

For little endian, buffer[byteOffset] is interpreted as low byte, whereas it is interpreted as high byte in big endian.

This is a reference function.




bytesToInt24
public static int bytesToInt24(byte[] buffer, int byteOffset, boolean bigEndian)(Code)
Converts 3 successive bytes starting at byteOffset in buffer to a signed integer sample with 24bit range.

For little endian, buffer[byteOffset] is interpreted as lowest byte, whereas it is interpreted as highest byte in big endian.

This is a reference function.




bytesToInt32
public static int bytesToInt32(byte[] buffer, int byteOffset, boolean bigEndian)(Code)
Converts a 4 successive bytes starting at byteOffset in buffer to a signed 32bit integer sample.

For little endian, buffer[byteOffset] is interpreted as lowest byte, whereas it is interpreted as highest byte in big endian.

This is a reference function.




bytesToShort16
public static short bytesToShort16(byte highByte, byte lowByte)(Code)
Converts 2 bytes to a signed sample of type short.

This is a reference function.




bytesToShort16
public static short bytesToShort16(byte[] buffer, int byteOffset, boolean bigEndian)(Code)
Converts 2 successive bytes starting at byteOffset in buffer to a signed sample of type short.

For little endian, buffer[byteOffset] is interpreted as low byte, whereas it is interpreted as high byte in big endian.

This is a reference function.




changeOrderOrSign
public static void changeOrderOrSign(byte[] buffer, int nOffset, int nByteLength, int nBytesPerSample)(Code)



changeOrderOrSign
public static void changeOrderOrSign(byte[] inBuffer, int nInOffset, byte[] outBuffer, int nOutOffset, int nByteLength, int nBytesPerSample)(Code)



convertSign8
public static void convertSign8(byte[] buffer, int byteOffset, int sampleCount)(Code)



convertSign8
public static void convertSign8(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)(Code)



intToBytes16
public static void intToBytes16(int sample, byte[] buffer, int byteOffset, boolean bigEndian)(Code)
Converts a 16 bit sample of type int to 2 bytes in an array. sample is interpreted as signed (as Java does).

For little endian, buffer[byteOffset] is filled with low byte of sample, and buffer[byteOffset+1] is filled with high byte of sample + sign bit.

For big endian, this is reversed.

Before calling this function, it should be assured that sample is in the 16bit range - it will not be clipped.

This is a reference function.




intToBytes24
public static void intToBytes24(int sample, byte[] buffer, int byteOffset, boolean bigEndian)(Code)
Converts a 24 bit sample of type int to 3 bytes in an array. sample is interpreted as signed (as Java does).

For little endian, buffer[byteOffset] is filled with low byte of sample, and buffer[byteOffset+2] is filled with the high byte of sample + sign bit.

For big endian, this is reversed.

Before calling this function, it should be assured that sample is in the 24bit range - it will not be clipped.

This is a reference function.




intToBytes32
public static void intToBytes32(int sample, byte[] buffer, int byteOffset, boolean bigEndian)(Code)
Converts a 32 bit sample of type int to 4 bytes in an array. sample is interpreted as signed (as Java does).

For little endian, buffer[byteOffset] is filled with lowest byte of sample, and buffer[byteOffset+3] is filled with the high byte of sample + sign bit.

For big endian, this is reversed.

This is a reference function.




linear2alaw
public static byte linear2alaw(short pcm_val)(Code)



linear2ulaw
public static byte linear2ulaw(int sample)(Code)
Converts a linear signed 16bit sample to a uLaw byte. Ported to Java by fb.
Originally by:
Craig Reese: IDA/Supercomputing Research Center
Joe Campbell: Department of Defense
29 September 1989



pcm162alaw
public static void pcm162alaw(byte[] buffer, int byteOffset, int sampleCount, boolean bigEndian)(Code)
Converts a buffer of signed 16bit big endian samples to uLaw. The uLaw bytes overwrite the original 16 bit values. The first byte-offset of the uLaw bytes is byteOffset. It will be written sampleCount/2 bytes.



pcm162alaw
public static void pcm162alaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean bigEndian)(Code)
Fills outBuffer with alaw samples. reading starts from inBuffer[inByteOffset]. writing starts at outBuffer[outByteOffset]. There will be sampleCount*2 bytes read from inBuffer; There will be sampleCount bytes written to outBuffer.



pcm162ulaw
public static void pcm162ulaw(byte[] buffer, int byteOffset, int sampleCount, boolean bigEndian)(Code)
Converts a buffer of signed 16bit big endian samples to uLaw. The uLaw bytes overwrite the original 16 bit values. The first byte-offset of the uLaw bytes is byteOffset. It will be written sampleCount/2 bytes.



pcm162ulaw
public static void pcm162ulaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean bigEndian)(Code)
Fills outBuffer with ulaw samples. reading starts from inBuffer[inByteOffset]. writing starts at outBuffer[outByteOffset]. There will be sampleCount*2 bytes read from inBuffer; There will be sampleCount bytes written to outBuffer.



pcm82alaw
public static void pcm82alaw(byte[] buffer, int byteOffset, int sampleCount, boolean signed)(Code)
Converts a buffer of 8bit samples to alaw. The alaw bytes overwrite the original 8 bit values. The first byte-offset of the aLaw bytes is byteOffset. It will be written sampleCount bytes.



pcm82alaw
public static void pcm82alaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean signed)(Code)
Fills outBuffer with alaw samples. reading starts from inBuffer[inByteOffset]. writing starts at outBuffer[outByteOffset]. There will be sampleCount bytes written to outBuffer.



pcm82ulaw
public static void pcm82ulaw(byte[] buffer, int byteOffset, int sampleCount, boolean signed)(Code)
Converts a buffer of 8bit samples to uLaw. The uLaw bytes overwrite the original 8 bit values. The first byte-offset of the uLaw bytes is byteOffset. It will be written sampleCount bytes.



pcm82ulaw
public static void pcm82ulaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean signed)(Code)
Fills outBuffer with ulaw samples. reading starts from inBuffer[inByteOffset]. writing starts at outBuffer[outByteOffset]. There will be sampleCount bytes written to outBuffer.



shortToBytes16
public static void shortToBytes16(short sample, byte[] buffer, int byteOffset, boolean bigEndian)(Code)
Converts a sample of type short to 2 bytes in an array. sample is interpreted as signed (as Java does).

For little endian, buffer[byteOffset] is filled with low byte of sample, and buffer[byteOffset+1] is filled with high byte of sample.

For big endian, this is reversed.

This is a reference function.




swapOrder16
public static void swapOrder16(byte[] buffer, int byteOffset, int sampleCount)(Code)



swapOrder16
public static void swapOrder16(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)(Code)



swapOrder24
public static void swapOrder24(byte[] buffer, int byteOffset, int sampleCount)(Code)



swapOrder24
public static void swapOrder24(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)(Code)



swapOrder32
public static void swapOrder32(byte[] buffer, int byteOffset, int sampleCount)(Code)



swapOrder32
public static void swapOrder32(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)(Code)



ulaw2alaw
public static byte ulaw2alaw(byte sample)(Code)



ulaw2alaw
public static void ulaw2alaw(byte[] buffer, int byteOffset, int sampleCount)(Code)
Converts a buffer of uLaw samples to aLaw.



ulaw2alaw
public static void ulaw2alaw(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount)(Code)
Fills outBuffer with alaw samples.



ulaw2linear
public static short ulaw2linear(byte ulawbyte)(Code)



ulaw2pcm16
public static void ulaw2pcm16(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean bigEndian)(Code)
Fills outBuffer with pcm signed 16 bit samples. reading starts from inBuffer[inByteOffset]. writing starts at outBuffer[outByteOffset]. There will be sampleCount bytes read from inBuffer; There will be sampleCount*2 bytes written to outBuffer.



ulaw2pcm8
public static void ulaw2pcm8(byte[] buffer, int byteOffset, int sampleCount, boolean signed)(Code)
Inplace-conversion of a ulaw buffer to 8bit samples. The 8bit bytes overwrite the original ulaw values. The first byte-offset of the uLaw bytes is byteOffset. It will be written sampleCount bytes.



ulaw2pcm8
public static void ulaw2pcm8(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount, boolean signed)(Code)
Fills outBuffer with ulaw samples. reading starts from inBuffer[inByteOffset]. writing starts at outBuffer[outByteOffset]. There will be sampleCount bytes written to outBuffer.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.