Structured Query Language

Overview

What is SQL?

SQL (pronounced “ess-que-el”) stands for Structured Query Language. SQL is used to communicate with a database. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems. SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database. Some common relational database management systems that use SQL are: Oracle, Sybase, Microsoft SQL Server, Access, Ingres, etc. Although most database systems use SQL, most of them also have their own additional proprietary extensions that are usually only used on their system. However, the standard SQL commands such as “Select”, “Insert”, “Update”, “Delete”, “Create”, and “Drop” can be used to accomplish almost everything that one needs to do with a database. This tutorial will provide you with the instruction on the basics of each of these commands as well as allow you to put them to practice using the SQL Interpreter.

Tables

A relational database system contains one or more objects called tables. The data or information for the database are stored in these tables. Tables are uniquely identified by their names and are comprised of columns and rows. Columns contain the column name, data type, and any other attributes for the column. Rows contain the records or data for the columns. Here is a sample table called “weather”.

city, state, high, and low are the columns. The rows contain the data for this table:

weather

city state high low
Phoenix Arizona 105 90
Tucson Arizona 101 92
Flagstaff Arizona 88 69
San Diego California 77 60
Albuquerque New Mexico 80 72

Retrieving Data

Basic Select

In a relational database, data is stored in tables. An example table would relate Social Security Number, Name, and Address:

EmployeeAddressTable
SSN FirstName LastName Address City State
512687458 Joe Smith 83 First Street Howard Ohio
758420012 Mary Scott 842 Vine Ave. Losantiville Ohio
102254896 Sam Jones 33 Elm St. Paris New York
876512563 Sarah Ackerman 440 U.S. 110 Upton Michigan

Now, let’s say you want to see the address of each employee. Use the SELECT statement, like so:

SELECT FirstName, LastName, Address, City, State
FROM EmployeeAddressTable;

The following is the results of your query of the database:

First Name Last Name Address City State
Joe Smith 83 First Street Howard Ohio
Mary Scott 842 Vine Ave. Losantiville Ohio
Sam Jones 33 Elm St. Paris New York
Sarah Ackerman 440 U.S. 110 Upton Michigan

To explain what you just did, you asked for the all of data in the EmployeeAddressTable, and specifically, you asked for the columns called FirstName, LastName, Address, City, and State. Note that column names and table names do not have spaces…they must be typed as one word; and that the statement ends with a semicolon (;). The general form for a SELECT statement, retrieving all of the rows in the table is:

SELECT ColumnName, ColumnName, ...
FROM TableName;

To get all columns of a table without typing all column names, use:

SELECT * FROM TableName;

Each database management system (DBMS) and database software has different methods for logging in to the database and entering SQL commands; see the local computer “guru” to help you get onto the system, so that you can use SQL.

Conditional Selection

To further discuss the SELECT statement, let’s look at a new example table (for hypothetical purposes only):

EmployeeStatisticsTable
EmployeeIDNo Salary Benefits Position
010 75000 15000 Manager
105 65000 15000 Manager
152 60000 15000 Manager
215 60000 12500 Manager
244 50000 12000 Staff
300 45000 10000 Staff
335 40000 10000 Staff
400 32000 7500 Entry-Level
441 28000 7500 Entry-Level

Relational Operators

There are six Relational Operators in SQL, and after introducing them, we’ll see how they’re used:

= Equal
<> or != Not Equal
< Less Than
> Greater Than
<= Less Than or Equal To
>= Greater Than or Equal To

The WHERE clause is used to specify that only certain rows of the table are displayed, based on the criteria described in that WHERE clause. It is most easily understood by looking at a couple of examples.

If you wanted to see the EMPLOYEEIDNO’s of those making at or over $50,000, use the following:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE SALARY >= 50000;

Notice that the >= (greater than or equal to) sign is used, as we wanted to see those who made greater than $50,000, or equal to $50,000, listed together. This displays:

EMPLOYEEIDNO
------------
010
105
152
215
244

The WHERE description, SALARY >= 50000, is known as a condition (an operation which evaluates to True or False). The same can be done for text columns:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE POSITION = 'Manager';

This displays the ID Numbers of all Managers. Generally, with text columns, stick to equal to or not equal to, and make sure that any text that appears in the statement is surrounded by single quotes (‘). Note: Position is now an illegal identifier because it is now an unused, but reserved, keyword in the SQL-92 standard.

Aggregate Functions

SQL has five important aggregate functions: SUM, AVG, MAX, MIN, and COUNT. They are called aggregate functions because they summarize the results of a query, rather than listing all of the rows.

  • SUM () gives the total of all the rows, satisfying any conditions, of the given column, where the given column is numeric.
  • AVG () gives the average of the given column.
  • MAX () gives the largest figure in the given column.
  • MIN () gives the smallest figure in the given column.
  • COUNT(*) gives the number of rows satisfying the conditions.

Looking at the tables at the top of the document, let’s look at three examples:

SELECT SUM(SALARY), AVG(SALARY)
FROM EMPLOYEESTATISTICSTABLE;

This query shows the total of all salaries in the table, and the average salary of all of the entries in the table.

SELECT MIN(BENEFITS)
FROM EMPLOYEESTATISTICSTABLE
WHERE POSITION = 'Manager';

This query gives the smallest figure of the Benefits column, of the employees who are Managers, which is 12500.

SELECT COUNT(*)
FROM EMPLOYEESTATISTICSTABLE
WHERE POSITION = 'Staff';

This query tells you how many employees have Staff status (3).

More Complex Conditions:
Compound Conditions / Logical Operators

The AND operator joins two or more conditions, and displays a row only if that row’s data satisfies ALL conditions listed (i.e. all conditions hold true). For example, to display all staff making over $40,000, use:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE SALARY > 40000 AND POSITION = 'Staff';

The OR operator joins two or more conditions, but returns a row if ANY of the conditions listed hold true. To see all those who make less than $40,000 or have less than $10,000 in benefits, listed together, use the following query:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE SALARY < 40000 OR BENEFITS < 10000;

AND & OR can be combined, for example:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE POSITION = 'Manager' AND SALARY > 60000 OR BENEFITS > 12000;

First, SQL finds the rows where the salary is greater than $60,000 and the position column is equal to Manager, then taking this new list of rows, SQL then sees if any of these rows satisfies the previous AND condition or the condition that the Benefits column is greater than $12,000. Subsequently, SQL only displays this second new list of rows, keeping in mind that anyone with Benefits over $12,000 will be included as the OR operator includes a row if either resulting condition is True. Also note that the AND operation is done first.

To generalize this process, SQL performs the AND operation(s) to determine the rows where the AND operation(s) hold true (remember: all of the conditions are true), then these results are used to compare with the OR conditions, and only display those remaining rows where any of the conditions joined by the OR operator hold true (where a condition or result from an AND is paired with another condition or AND result to use to evaluate the OR, which evaluates to true if either value is true). Mathematically, SQL evaluates all of the conditions, then evaluates the AND “pairs”, and then evaluates the OR’s (where both operators evaluate left to right).

To look at an example, for a given row for which the DBMS is evaluating the SQL statement Where clause to determine whether to include the row in the query result (the whole Where clause evaluates to True), the DBMS has evaluated all of the conditions, and is ready to do the logical comparisons on this result:

True AND False OR True AND True OR False AND False

First simplify the AND pairs:

False OR True OR False

Now do the OR’s, left to right:

True OR False
True

The result is True, and the row passes the query conditions. Be sure to see the next section on NOT’s, and the order of logical operations. I hope that this section has helped you understand AND’s or OR’s, as it’s a difficult subject to explain briefly.

To perform OR’s before AND’s, like if you wanted to see a list of employees making a large salary ($50,000) or have a large benefit package ($10,000), and that happen to be a manager, use parentheses:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE POSITION = 'Manager' AND (SALARY > 50000 OR BENEFITS > 10000);

IN & BETWEEN

An easier method of using compound conditions uses IN or BETWEEN. For example, if you wanted to list all managers and staff:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE POSITION IN ('Manager', 'Staff');

or to list those making greater than or equal to $30,000, but less than or equal to $50,000, use:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE SALARY BETWEEN 30000 AND 50000;

To list everyone not in this range, try:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE SALARY NOT BETWEEN 30000 AND 50000;

Similarly, NOT IN lists all rows excluded from the IN list.

Additionally, NOT’s can be thrown in with AND’s & OR’s, except that NOT is a unary operator (evaluates one condition, reversing its value, whereas, AND’s & OR’s evaluate two conditions), and that all NOT’s are performed before any AND’s or OR’s.

SQL Order of Logical Operations (each operates from left to right)

  1. NOT
  2. AND
  3. OR

Using LIKE

Look at the EmployeeStatisticsTable, and say you wanted to see all people whose last names started with “S”; try:

SELECT EMPLOYEEIDNO
FROM EMPLOYEEADDRESSTABLE
WHERE LASTNAME LIKE 'S%';

The percent sign (%) is used to represent any possible character (number, letter, or punctuation) or set of characters that might appear after the “S”. To find those people with LastName’s ending in “S”, use ‘%S’, or if you wanted the “S” in the middle of the word, try ‘%S%’. The ‘%’ can be used for any characters in the same position relative to the given characters. NOT LIKE displays rows not fitting the given description. Other possibilities of using LIKE, or any of these discussed conditionals, are available, though it depends on what DBMS you are using; as usual, consult a manual or your system manager or administrator for the available features on your system, or just to make sure that what you are trying to do is available and allowed. This disclaimer holds for the features of SQL that will be discussed below. This section is just to give you an idea of the possibilities of queries that can be written in SQL.

Joins

In this section, we will only discuss inner joins, and equijoins, as in general, they are the most useful.

Good database design suggests that each table lists data only about a single entity, and detailed information can be obtained in a relational database, by using additional tables, and by using a join.

First, take a look at these example tables:

AntiqueOwners

OwnerID OwnerLastName OwnerFirstName
01 Jones Bill
02 Smith Bob
15 Lawson Patricia
21 Akins Jane
50 Fowler Sam

Orders

OwnerID ItemDesired
02 Table
02 Desk
21 Chair
15 Mirror

Antiques

SellerID BuyerID Item
01 50 Bed
02 15 Table
15 02 Chair
21 50 Mirror
50 01 Desk
01 21 Cabinet
02 21 Coffee Table
15 50 Chair
01 15 Jewelry Box
02 21 Pottery
21 02 Bookcase
50 01 Plant Stand

Keys

First, let’s discuss the concept of keys. A primary key is a column or set of columns that uniquely identifies the rest of the data in any given row. For example, in the AntiqueOwners table, the OwnerID column uniquely identifies that row. This means two things: no two rows can have the same OwnerID, and, even if two owners have the same first and last names, the OwnerID column ensures that the two owners will not be confused with each other, because the unique OwnerID column will be used throughout the database to track the owners, rather than the names.

A foreign key is a column in a table where that column is a primary key of another table, which means that any data in a foreign key column must have corresponding data in the other table where that column is the primary key. In DBMS-speak, this correspondence is known as referential integrity. For example, in the Antiques table, both the BuyerID and SellerID are foreign keys to the primary key of the AntiqueOwners table (OwnerID; for purposes of argument, one has to be an Antique Owner before one can buy or sell any items), as, in both tables, the ID rows are used to identify the owners or buyers and sellers, and that the OwnerID is the primary key of the AntiqueOwners table. In other words, all of this “ID” data is used to refer to the owners, buyers, or sellers of antiques, themselves, without having to use the actual names.

Performing a Join

The purpose of these keys is so that data can be related across tables, without having to repeat data in every table–this is the power of relational databases. For example, you can find the names of those who bought a chair without having to list the full name of the buyer in the Antiques table…you can get the name by relating those who bought a chair with the names in the AntiqueOwners table through the use of the OwnerID, which relates the data in the two tables. To find the names of those who bought a chair, use the following query:

SELECT OWNERLASTNAME, OWNERFIRSTNAME
FROM ANTIQUEOWNERS, ANTIQUES
WHERE BUYERID = OWNERID AND ITEM = 'Chair';

Note the following about this query…notice that both tables involved in the relation are listed in the FROM clause of the statement. In the WHERE clause, first notice that the ITEM = ‘Chair’ part restricts the listing to those who have bought (and in this example, thereby own) a chair. Secondly, notice how the ID columns are related from one table to the next by use of the BUYERID = OWNERID clause. Only where ID’s match across tables and the item purchased is a chair (because of the AND), will the names from the AntiqueOwners table be listed. Because the joining condition used an equal sign, this join is called an equijoin. The result of this query is two names: Smith, Bob & Fowler, Sam.

Dot notation refers to prefixing the table names to column names, to avoid ambiguity, as follows:

SELECT ANTIQUEOWNERS.OWNERLASTNAME, ANTIQUEOWNERS.OWNERFIRSTNAME
FROM ANTIQUEOWNERS, ANTIQUES
WHERE ANTIQUES.BUYERID = ANTIQUEOWNERS.OWNERID AND ANTIQUES.ITEM = 'Chair';

As the column names are different in each table, however, this wasn’t necessary. In general, you should always use Dot notation as when you change your database, some queries that did not use Dot notation may cease working because they become ambiguous.

GROUP BY & HAVING

One special use of GROUP BY is to associate an aggregate function (especially COUNT; counting the number of rows in each group) with groups of rows. First, assume that the Antiques table has the Price column, and each row has a value for that column. We want to see the price of the most expensive item bought by each owner. We have to tell SQL to group each owner’s purchases, and tell us the maximum purchase price:

SELECT BUYERID, MAX(PRICE)
FROM ANTIQUES
GROUP BY BUYERID;

Now, say we only want to see the maximum purchase price if the purchase is over $1000, so we use the HAVING clause:

SELECT BUYERID, MAX(PRICE)
FROM ANTIQUES
GROUP BY BUYERID
HAVING PRICE > 1000;

DISTINCT and Eliminating Duplicates

Let’s say that you want to list the ID and names of only those people who have sold an antique. Obviously, you want a list where each seller is only listed once–you don’t want to know how many antiques a person sold, just the fact that this person sold one (for counts, see the Aggregate Function section below). This means that you will need to tell SQL to eliminate duplicate sales rows, and just list each person only once. To do this, use the DISTINCT keyword.

First, we will need an equijoin to the AntiqueOwners table to get the detail data of the person’s LastName and FirstName. However, keep in mind that since the SellerID column in the Antiques table is a foreign key to the AntiqueOwners table, a seller will only be listed if there is a row in the AntiqueOwners table listing the ID and names. We also want to eliminate multiple occurrences of the SellerID in our listing, so we use DISTINCT on the column where the repeats may occur (however, it is generally not necessary to strictly put the Distinct in front of the column name).

To throw in one more twist, we will also want the list alphabetized by LastName, then by FirstName (on a LastName tie). Thus, we will use the ORDER BY clause:

SELECT DISTINCT SELLERID, OWNERLASTNAME, OWNERFIRSTNAME
FROM ANTIQUES, ANTIQUEOWNERS
WHERE SELLERID = OWNERID
ORDER BY OWNERLASTNAME, OWNERFIRSTNAME;

In this example, since everyone has sold an item, we will get a listing of all of the owners, in alphabetical order by last name. For future reference (and in case anyone asks), this type of join is considered to be in the category of inner joins.

Aliases & In/Subqueries

In this section, we will talk about Aliases, In and the use of subqueries, and how these can be used in a 3-table example. First, look at this query which prints the last name of those owners who have placed an order and what the order is, only listing those orders which can be filled (that is, there is a buyer who owns that ordered item):

SELECT OWN.OWNERLASTNAME Last Name, ORD.ITEMDESIRED Item Ordered
FROM ORDERS ORD, ANTIQUEOWNERS OWN
WHERE ORD.OWNERID = OWN.OWNERID
AND ORD.ITEMDESIRED IN

(SELECT ITEM
FROM ANTIQUES);
This gives:

Last Name Item Ordered
--------- ------------
Smith     Table
Smith     Desk
Akins     Chair
Lawson    Mirror

There are several things to note about this query:

  1. First, the “Last Name” and “Item Ordered” in the Select lines gives the headers on the report.
  2. The OWN & ORD are aliases; these are new names for the two tables listed in the FROM clause that are used as prefixes for all dot notations of column names in the query (see above). This eliminates ambiguity, especially in the equijoin WHERE clause where both tables have the column named OwnerID, and the dot notation tells SQL that we are talking about two different OwnerID’s from the two different tables.
  3. Note that the Orders table is listed first in the FROM clause; this makes sure listing is done off of that table, and the AntiqueOwners table is only used for the detail information (Last Name).
  4. Most importantly, the AND in the WHERE clause forces the In Subquery to be invoked (“= ANY” or “= SOME” are two equivalent uses of IN). What this does is, the subquery is performed, returning all of the Items owned from the Antiques table, as there is no WHERE clause. Then, for a row from the Orders table to be listed, the ItemDesired must be in that returned list of Items owned from the Antiques table, thus listing an item only if the order can be filled from another owner. You can think of it this way: the subquery returns a set of Items from which each ItemDesired in the Orders table is compared; the In condition is true only if the ItemDesired is in that returned set from the Antiques table.
  5. Also notice, that in this case, that there happened to be an antique available for each one desired…obviously, that won’t always be the case. In addition, notice that when the IN, “= ANY”, or “= SOME” is used, that these keywords refer to any possible row matches, not column matches…that is, you cannot put multiple columns in the subquery Select clause, in an attempt to match the column in the outer Where clause to one of multiple possible column values in the subquery; only one column can be listed in the subquery, and the possible match comes from multiple row values in that one column, not vice-versa.

More Subqueries

Another common usage of subqueries involves the use of operators to allow a Where condition to include the Select output of a subquery. First, list the buyers who purchased an expensive item (the Price of the item is $100 greater than the average price of all items purchased):

SELECT BUYERID
FROM ANTIQUES
WHERE PRICE >

(SELECT AVG(PRICE) + 100
FROM ANTIQUES);
The subquery calculates the average Price, plus $100, and using that figure, an OwnerID is printed for every item costing over that figure. One could use DISTINCT BUYERID, to eliminate duplicates.

List the Last Names of those in the AntiqueOwners table, ONLY if they have bought an item:

SELECT OWNERLASTNAME
FROM ANTIQUEOWNERS
WHERE OWNERID IN

(SELECT DISTINCT BUYERID
FROM ANTIQUES);
The subquery returns a list of buyers, and the Last Name is printed for an Antique Owner if and only if the Owner’s ID appears in the subquery list (sometimes called a candidate list). Note: on some DBMS’s, equals can be used instead of IN, but for clarity’s sake, since a set is returned from the subquery, IN is the better choice.

For an Update example, we know that the gentleman who bought the bookcase has the wrong First Name in the database…it should be John:

UPDATE ANTIQUEOWNERS
SET OWNERFIRSTNAME = 'John'
WHERE OWNERID =

(SELECT BUYERID
FROM ANTIQUES
WHERE ITEM = 'Bookcase');
First, the subquery finds the BuyerID for the person(s) who bought the Bookcase, then the outer query updates his First Name.

Remember this rule about subqueries: When you have a subquery as part of a WHERE condition, the Select clause in the subquery must have columns that match in number and type to those in the Where clause of the outer query. In other words, if you have “WHERE ColumnName = (SELECT...);“, the Select must have only one column in it, to match the ColumnName in the outer Where clause, and they must match in type (both being integers, both being character strings, etc.).

Adding, Modifying, and Deleting Data

Adding Data

To insert rows into a table, do the following:

INSERT INTO ANTIQUES VALUES (21, 01, 'Ottoman', 200.00);

This inserts the data into the table, as a new row, column-by-column, in the pre-defined order. Instead, let’s change the order and leave Price blank:

INSERT INTO ANTIQUES (BUYERID, SELLERID, ITEM)
VALUES (01, 21, 'Ottoman');

Deleting Data

Let’s delete this new row back out of the database:

DELETE FROM ANTIQUES
WHERE ITEM = 'Ottoman';

But if there is another row that contains ‘Ottoman’, that row will be deleted also. Let’s delete all rows (one, in this case) that contain the specific data we added before:

DELETE FROM ANTIQUES
WHERE ITEM = 'Ottoman' AND BUYERID = 01 AND SELLERID = 21;

Updating Data

Let’s update a Price into a row that doesn’t have a price listed yet:

UPDATE ANTIQUES SET PRICE = 500.00 WHERE ITEM = 'Chair';

This sets all Chair’s Prices to 500.00. As shown above, more WHERE conditionals, using AND, must be used to limit the updating to more specific rows. Also, additional columns may be set by separating equal statements with commas.

Modifying the Database

Creating New Tables

All tables within a database must be created at some point in time…let’s see how we would create the Orders table:

CREATE TABLE ORDERS
(OWNERID INTEGER NOT NULL,
ITEMDESIRED CHAR(40) NOT NULL);

This statement gives the table name and tells the DBMS about each column in the table. Please note that this statement uses generic data types, and that the data types might be different, depending on what DBMS you are using. As usual, check local listings. Some common generic data types are:

 

  • Char(x) – A column of characters, where x is a number designating the maximum number of characters allowed (maximum length) in the column.
  • Integer – A column of whole numbers, positive or negative.
  • Decimal(x, y) – A column of decimal numbers, where x is the maximum length in digits of the decimal numbers in this column, and y is the maximum number of digits allowed after the decimal point. The maximum (4,2) number would be 99.99.
  • Date – A date column in a DBMS-specific format.
  • Logical – A column that can hold only two values: TRUE or FALSE.

One other note, the NOT NULL means that the column must have a value in each row. If NULL was used, that column may be left empty in a given row.

Altering Tables

Let’s add a column to the Antiques table to allow the entry of the price of a given Item (Parentheses optional):

ALTER TABLE ANTIQUES ADD (PRICE DECIMAL(8,2) NULL);

The data for this new column can be updated or inserted as shown later.

Indexes

Indexes allow a DBMS to access data quicker (please note: this feature is nonstandard/not available on all systems). The system creates this internal data structure (the index) which causes selection of rows, when the selection is based on indexed columns, to occur faster. This index tells the DBMS where a certain row is in the table given an indexed-column value, much like a book index tells you what page a given word appears. Let’s create an index for the OwnerID in the AntiqueOwners table:

CREATE INDEX OID_IDX ON ANTIQUEOWNERS (OWNERID);

Now on the names:

CREATE INDEX NAME_IDX ON ANTIQUEOWNERS (OWNERLASTNAME, OWNERFIRSTNAME);

To get rid of an index, drop it:

DROP INDEX OID_IDX;

By the way, you can also “drop” a table, as well (careful!–that means that your table is deleted). In the second example, the index is kept on the two columns, aggregated together–strange behavior might occur in this situation…check the manual before performing such an operation.

Some DBMS’s do not enforce primary keys; in other words, the uniqueness of a column is not enforced automatically. What that means is, if, for example, I tried to insert another row into the AntiqueOwners table with an OwnerID of 02, some systems will allow me to do that, even though we do not, as that column is supposed to be unique to that table (every row value is supposed to be different). One way to get around that is to create a unique index on the column that we want to be a primary key, to force the system to enforce prohibition of duplicates:

CREATE UNIQUE INDEX OID_IDX ON ANTIQUEOWNERS (OWNERID);

 

ISDN CAUSE CODES

Cause No. 0
This is usually given by the router when none of the other codes apply. This cause usually occurs in the same type of situations as cause 1, cause 88, and cause 100.

Cause No. l – Unallocated (unassigned) number.
This cause indicates that the destination requested by the calling user cannot be reached because, although the number is in a valid format, it is not currently assigned (allocated).

What it usually means:

  1. The SPIDS may be incorrectly entered in the router or the Telco switch, giving a SPID failure in the router logs.
  2. The ISDN phone number being dialed by the router is invalid and the telco switch cannot locate the number to complete the call, as it is invalid.
  3. On long distance calls, the call cannot be properly routed to its destination.

Cause No. 2 – No route to specified transit network (national use).
This cause indicates that the equipment sending this cause has received a request to route the call through a particular transit network which it does not recognize. The equipment sending this cause does not recognize the transit network either because the transit network does not exist or because that particular transit network not serve the equipment which is sending this cause.

Cause No. 3 – No route to destination.
This cause indicates that the called party cannot be reached because the network through which the call has been routed does not serve the destination desired. This cause is supported on a network dependent basis.

Cause No. 4 – send special information tone.
This cause indicates that the called party cannot be reached for reasons that are of a long term nature and that the special information tone should be returned to the calling party.

Cause No. 5 – misdialed trunk prefix (national use).
This cause indicates the erroneous inclusion of a trunk prefix in the called party number. This number is to sniped from the dialed number being sent to the network by the customer premises equipment.

Cause No. 6 – channel unacceptable.
This cause indicates that the channel most recently identified is not acceptable to the sending entity for use in this call.

Cause No. 7 – call awarded. being delivered in an established channel.
This cause indicates that the user has been awarded the incoming call and that the incoming call is being connected to a channel already established to that user for similar calls (e.g. packet-mode x.25 virtual calls).

Cause No. 8 – preemption.
This cause indicates the call is being preempted.

Cause No. 9 – preemption – circuit reserved for reuse.
This cause indicates that the call is being preempted and the circuit is reserved for reuse by the preempting exchange.

Cause No. 16 – normal call clearing.
This cause indicates that the call is being cleared because one of the users involved in the call has requested that the call be cleared.

What it means:
This could be almost anything; it is the vaguest of the cause codes. The call comes down normally, but the reasons for it could be:

  1. Bad username or password
  2. Router’s settings do not match what is expected by the remote end.
  3. Telephone line problems.
  4. Hung session on remote end.

Cause No. 17 – user busy.
This cause is used to indicate that the called party is unable to accept another call because the user busy condition has been encountered. This cause value may be generated by the called user or by the network. In the case of user determined user busy it is noted that the user equipment is compatible with the call.

What is means:
Calling end is busy.
Cause No. 18 – no user responding.
This cause is used when a called party does not respond to a call establishment message with either an alerting or connect indication within the prescribed period of time allocated.

What it means:
The equipment on the other end does not answer the call. Usually this is a misconfiguration on the equipment being called.
Cause No. 19 – no answer from user (user alerted).
This cause is used when the called party has been alerted but does not respond with a connect indication within a prescribed period of time. Note – This cause is not necessarily generated by Q.931 procedures but may be generated by internal network timers.

Cause No. 20 – subscriber absent.
This cause value is used when a mobile station has logged off. Radio contact is not obtained with a mobile station or if a personal telecommunication user is temporarily not addressable at any user-network interface.

Cause No. 21 – call rejected.
This cause indicates that the equipment sending this cause does not wish to accept this call. although it could have accepted the call because the equipment sending this cause is neither busy nor incompatible. This cause may also be generated by the network, indicating that the call was cleared due to a supplementary service constraint. The diagnostic field may contain additional information about the supplementary service and reason for rejection.

What it means:
This is usually a telco issue. The call never reaches the final destination, which can be caused by a bad switch translation, or a misconfiguration on the equipment being called.
Cause No. 22 – number changed.
This cause is returned to a calling party when the called party number indicated by the calling party is no longer assigned. The new called party number may optionally be included in the diagnostic field. If a network does not support this cause, cause no. 1, unallocated (unassigned) number shall be used.

Cause No. 26 – non-selected user clearing.
This cause indicates that the user has not been awarded the incoming call.

Cause No. 27 – destination out of order.
This cause indicates that the destination indicated by the user cannot be reached because the interface to the destination is not functioning correctly. The term “not functioning correctly” indicates that a signal message was unable to be delivered to the remote party; e.g., a physical layer or data link layer failure at the remote party or user equipment off-line.

Cause No. 28 – invalid number format (address incomplete).
This cause indicates that the called party cannot be reached because the called party number is not in a valid format or is not complete.

Cause No. 29 – facilities rejected.
This cause is returned when a supplementary service requested by the user cannot be provide by the network.

Cause No. 30 – response to STATUS INQUIRY.
This cause is included in the STATUS message when the reason for generating the STATUS message was the prior receipt of a STATUS INQUIRY.

Cause No. 31 – normal. unspecified.
This cause is used to report a normal event only when no other cause in the normal class applies.

Cause No. 34 – no circuit/channel available.
This cause indicates that there is no appropriate circuit/channel presently available to handle the call.

What it means:
There is no place on the Public Telephone network to place the call; the call never gets to its destiation. This is usually a temporary problem.
Cause No. 35 – Call Queued.

Cause No. 38 – network out of order.
This cause indicates that the network is not functioning correctly and that the condition is likely to last a relatively long period of time e.g., immediately re-attempting the call is not likely to be successful.

Cause No. 39 – permanent frame mode connection out-of-service.
This cause is included in a STATUS message to indicate that a permanently established frame mode connection is out-of-service (e.g. due to equipment or section failure)

Cause No. 40 – permanent frame mode connection operational.
This cause is included in a STATUS message to indicate that a permanently established frame mode connection is operational and capable of carrying user information.

Cause No. 41 – temporary failure.

This cause indicates that the network is not functioning correctly and that the condition is no likely to last a long period of time; e.g., the user may wish to try another call attempt almost immediately.

What it means:
This means that there is a temporary failure at the physical layer on the ISDN network. If you remove the ISDN cable from the Netopia, you would see this. It’s usually temporary.
Cause No. 42 – switching equipment congestion.
This cause indicates that the switching equipment generating this cause is experiencing a period of high traffic.

What it means:
Just too much going on at this point on the ISDN network to get the call through to its destination.
Cause No. 43 – access information discarded.
This cause indicates that the network could not deliver access information to the remote user as requested. i.e., user-to-user information, low layer compatibility, high layer compatibility or sub-address as indicated in the diagnostic. It is noted that the particular type of access information discarded is optionally included in the diagnostic.

Cause No. 44 – requested circuit/channel not available.
This cause is returned when the circuit or channel indicated by the requesting entity cannot be provided by the other side of the interface.

Cause No. 46 – precedence call blocked.
This cause indicates that there are no predictable circuits or that the called user is busy with a call of equal or higher preventable level.

Cause No. 47 – resource unavailable, unspecified.
This cause is used to report a resource unavailable event only when no other cause in the resource unavailable class applies.

Cause No. 49 – Quality of Service not available.
This cause is used to report that the requested Quality of Service, as defined in Recommendation X.213. cannot be provided (e.g., throughput of transit delay cannot be supported).

Cause No. 50 – requested facility not subscribed.
This cause indicates that the user has requested a supplementary service which is implemented by the equipment which generated this cause but the user is not authorized to use.

What it means:
The switch looks at the number being dialed and thinks it is for another service rather than ISDN. If the phone number is put in the correct format, the call should be placed properly. There are no standards for this, all Telcos have their own system for programming the number formats that the switches will recognize. Some systems want to see 7 digits, some 10, and others 11.
Cause No. 52 – outgoing calls barred.

Cause No. 53 – outgoing calls barred within CUG.
This cause indicates that although the calling party is a member of the CUG for the outgoing CUG call. Outgoing calls are not allowed for this member of the CUG.

Cause No. 54 – incoming calls barred

Cause No. 55 – incoming calls barred within CUG.
This cause indicates that although the calling party is a member of the CUG for the incoming CUG call. Incoming calls are not allowed for this member of the CUG.

Cause No. 57 – bearer capability not authorized.
This cause indicates that the user has requested a bearer capability which is implemented by the equipment which generated this cause but the user is not authorized to use.

Cause No. 58 – bearer capability not presently available.
This cause indicates that the user has requested a bearer capability which is implemented by the equipment which generated this cause but which is not available at this time.

Cause No. 62 – inconsistency in outgoing information element.
This cause indicates an inconsistency in the designated outgoing access information and subscriber class.

Cause No. 63 – service or option not available. unspecified.
This cause is used to report a service or option not available event only when no other cause in the service or option not available class applies.

Cause No. 65 – bearer capability not implemented.
This cause indicates that the equipment sending this cause does not support the bearer capability requested.

What it means:

  1. In most cases, the number being called is not an ISDN number but an analog destination.
  2. The equipment is dialing at a faster rate than the circuitry allows, for example, dialing at 64K when only 56K is supported.

Cause No. 66 – channel type not implemented.
This cause indicates that the equipment sending this cause does not support the channel type requested.

Cause No. 69 – requested facility not implemented.
This cause indicates that the equipment sending this cause does not support the requested supplementary services.

Cause No. 70 – only restricted digital information bearer capability is available.
This cause indicates that the calling party has requested an unrestricted bearer service but the equipment sending this cause only supports the restricted version of the requested bearer capability.

Cause No. 79 – service or option not implemented unspecified.
This cause is used to report a service or option not implemented event only when no other cause in the service or option not implemented class applies.

Cause No. 81 – invalid call reference value.
This cause indicates that the equipment sending this cause has received a message with a call reference which is not currently in use on the user-network interface.

Cause No. 82 – identified channel does not exist.
This cause indicates that the equipment sending this cause has received a request to use a channel not activated on the interface for a call. For example, if a user has subscribed to those channels on a primary rate interface numbered from l to 12 and the user equipment or the network attempts to use channels 3 through 23, this cause is generated.

Cause No. 83 – a suspended call exists, but this call identify does not. This cause indicates that a call resume has been attempted with a call identity which differs from that in use for any presently suspended call(s).

Cause No. 84 – call identity in use.
This cause indicates that the network has received a call suspended request containing a call identity (including the null call identity) which is already in use for a suspended call within the domain of interfaces over which the call might be resumed.

Cause No. 85 – no call suspended.
This cause indicates that the network has received a call resume request containing a call identity information element which presently does not indicate any suspended call within the domain of interfaces over which calls may be resumed.

Cause No. 86 – call having the requested call identity has been cleared.
This cause indicates that the network has received a call resume request containing a call identity information element indicating a suspended call that has in the meantime been cleared while suspended (either by network time-out or by the remote user).

Cause No. 87 – user not a member of CUG.
This cause indicates that the called user for the incoming CUG call is not a member of the specified CUG or that the calling user is an ordinary subscriber calling a CUG subscriber.

Cause No. 88 – incompatible destination.
This cause indicates that the equipment sending this cause has received a request to establish a call which has low layer compatibility. high layer compatibility or other compatibility attributes (e.g., data rate) which cannot be accommodated.

What it means:

  1. This usually means that the Number To Dial in the Connection Profile is in the wrong format. You may need to dial a 10 or 11 digit number, or dial a 9 in front of the number if it is a Centrex line.
  2. This problem may also give a Cause 111.
  3. Dialing at the wrong line speed can also give this Cause.

Cause No. 90 – non-existent CUG.
This cause indicates that the specified CUG does not exist.

Cause No. 91 – invalid transit network selection (national use).
This cause indicates that a transit network identification was received which is of an incorrect format as defined in Annex C/Q.931

Cause No. 95 – invalid message, unspecified.
This cause is used to report an invalid message event only when no other cause in the invalid message class applies.

Cause No. 96 – mandatory information element is missing.
This cause indicates that the equipment sending this cause has received a message which is missing an information element which must be present in the message before that message can be processed.

What it means:
This is rarely seen in North America but usually means that the number that is being dialed is in the wrong format, (similar to cause 88). Some part of the format being used is not understood by either the remote side equipment or the switching equipment between the source and destination of the call.
Cause No. 97 – message type non-existent or not implemented.
This cause indicates that the equipment sending this cause has received a message with a message type it does not recognize either because this is a message not defined of defined but not implemented by the equipment sending this cause.

Cause No. 98 – message not compatible with call state or message type non-existent.
This cause indicates that the equipment sending this cause has received a message such that the procedures do not indicate that this is a permissible message to receive while in the call state, or a STATUS message was received indicating an incompatible call state.

Cause No. 99 – Information element / parameter non-existent or not implemented.
This cause indicates that the equipment sending this cause has received a message which includes information element(s)/parameter(s) not recognized because the information element(s)/parameter name(s) are not defined or are defined but not implemented by the equipment sending the cause. This cause indicates that the information element(s)/parameter(s) were discarded. However, the information element is not required to be present in the message in order for the equipment sending the cause to process the message.

Cause No. 100 – Invalid information element contents.
This cause indicates that the equipment sending this cause has received and information element which it has implemented; however, one or more of the fields in the information element are coded in such a way which has not been implemented by the equipment sending this cause.

What it means:
Like cause 1 and cause 88, this usually indicates that the ISDN number being dialed is in a format that is not understood by the equipment processing the call. SPIDs will sometimes fail to initialize with a Cause 100, or a call will fail with this cause.
Cause No. 101 – message not compatible with call state.
This cause indicates that a message has been received which is incompatible with the call state.

Cause No. 102 – recovery on timer expiry.
This cause indicates that a procedure has been initiated by the expiration of a timer in association with error handling procedures.

What it means:
This is seen in situations where ACO (Alternate Call Offering) is being used. With this type of call pre-emption, the Telco switch operates a timer. For example, when an analog call is placed to a Netopia router that has two B Data Channels in place, the router relinquishes the second channel, but if it doesn’t happen in the time allotted by the switch programming, the call will not ring through and will be discarded by the switch.
Cause No. 103 – parameter non-existent or not implemented – passed on (national use).
This cause indicates that the equipment sending this cause has received a message which includes parameters not recognized because the parameters are not defined or are defined but not implemented by the equipment sending this cause. The cause indicates that the parameter(s) were ignored. In addition, if the equipment sending this cause is an intermediate point, then this cause indicates that the parameter(s) were passed unchanged.

Cause No. 110 – message with unrecognized parameter discarded.
This cause indicates that the equipment sending this cause has discarded a received message which includes a parameter that is not recognized.

Cause No. 111 – protocol error, unspecified.
This cause is used to report a protocol error event only when no other cause in the protocol error class applies.

Cause No. 127 – Intel-working, unspecified.
This cause indicates that an interworking call (usually a call to 5W56 service) has ended.

Notes about Cause Codes over 128
Cause code values of 128 and higher aren’t sent over the network. A terminal displaying a value 128 or higher and claiming it is a cause code arguably has a bug or is implementing some proprietary diagnostic code (not necessarily bad). Some commendation has cause codes listed with numbers higher than 128, but at this time they are proprietary in nature.

The PRI equipment vendors are the most likely to use these codes as they have been using proprietary messages in the facilities data link for some time now (there is an as yet undefined area in the FDL which is big enough to carry small datagrams or messages). It is typically used to pass proprietary control or maintenance messages between multiplexers.

Como ativar a hibernação no Ubuntu 14.04

No Ubuntu 14.04, a hibernação vem desabilitada por padrão, mas felizmente, existe um modo de ativá-la. Veja aqui como fazer isso.
hibernar
Normalmente quando o computador hiberna, todos os seus aplicativos e documentos são salvos e o computador desliga completamente, mas quando você liga o computador novamente, os aplicativos e documentos ainda serão abertos como estavam. Se isso não ocorre, você pode perder muita coisa. Este tutorial irá mostrar como ativar o recurso de hibernação no Ubuntu 14.04 Trusty Tahr, para que você possa trabalhar mais tranquilamente.

Teste se a hibernação funciona no seu PC

Antes de fazer qualquer modificação no Ubuntu, é importante checar se a hibernação funcionará em seu equipamento. Para isso, abra um terminal (Usando o Dash ou pressionando as teclas CTRL+ALT+T) e digite o comando:

Depois que o computador for desligado, ligue-o novamente e veja se seus aplicativos que estavam abertos irão reabrir. Se a hibernação não funcionar, verifique se a sua partição swap é pelo menos tão grande quanto a sua memória RAM disponível.

Ativando a opção “Hibernar” no menu do Ubuntu

Para ativar a opção “Hibernar” no menu do Ubuntu, faça o seguinte:
Passo 1. Abra um terminal (Usando o Dash ou pressionando as teclas CTRL+ALT+T)
Passo 2. Torne-se administrador com o comando:

Passo 3. Vá para a pasta do sistema onde ficará a configuração:

Passo 4. Crie um arquivo de configuração, chamando o gedit:

Passo 5. Com o arquivo aberto, copie as linhas a seguir e cole dentro do arquivo;

Passo 6. Salve o arquivo e feche-o.
Passo 7. Reinicie o computador e a opção já estará disponível no menu do sistema.
hibernar-q

Colocando seu laptop para hibernar quando a tampa for fechada

Para deixar a hibernação completa, é preciso configurar o recurso para ser ativado quando a tampa do seus laptop for fechada. Para isso, faça o seguinte:
Passo 1. Abra um terminal (Usando o Dash ou pressionando as teclas CTRL+ALT+T)
Passo 2. Edite o arquivo de configuração /etc/systemd/logind.conf usando o comando:

Passo 3. Altere a linha #HandleLidSwitch=suspend para HandleLidSwitch=hibernate e salve o arquivo;
Passo 4. Execute o comando abaixo ou simplesmente reinicie o computador, para aplicar as alterações;

Pronto! Agora você já pode usar seu equipamento com mais tranquilidade, sem ficar se preocupando com seus documentos.

Via UbuntuHandbook

Uma Introdução Básica ao SoX

O que é o SoX?

SoX (Sound eXchange) é, como o autor o chama, o “canivete Suíço dos programas de processamento de som”. Ele é gratuito, livre/de código aberto e roda em Windows, Mac e Linux.

O SoX pode reproduzir, gravar, converter, editar, dividir, combinar e aplicar vários efeitos a arquivos de áudio de muitos formatos diferentes.

Formatos Suportados

Em uma instalação padrão do Slackware Linux 13.37, os formatos suportados pelo SoX são:

8svx, aif, aifc, aiff, aiffc, al, amb, au, avr, caf, cdda, cdr, cvs, cvsd, cvu, dat, dvms, f32, f4, f64, f8, fap, flac, fssd, gsm, gsrt, hcom, htk, ima, ircam, la, lpc, lpc10, lu, mat, mat4, mat5, maud, mp2, mp3, nist, ogg, paf, prc, pvf, raw, s1, s16, s2, s24, s3, s32, s4, s8, sb, sd2, sds, sf, sl, smp, snd, sndfile (formatos suportados pela biblioteca Libsndfile), sndr, sndt, sou, sox ( formato interno), sph, sw, txw, u1, u16, u2, u24, u3, u32, u4, u8, ub, ul, uw, vms, voc, vorbis, vox, w64, wav, wavpcm, wv, wve, xa, xi

E mais alguns outros caso as bibliotecas associadas estejam instaladas.

Apenas alguns dos efeitos suportados:

bandpass (filtro passa-banda), chorus, delay, echo (eco), equalizer (equalizador), fade (fade in e out), highpass (filtro passa-alta), lowpass (filtro passa-baixa), pitch (altera apenas o tom), reverb (reverberação), reverse (inversão), riaa, speed (altera a velocidade e o tom), synth (gera formas básicas de onda), tempo (altera apenas a velocidade), tremolo, trim, vocoder

Para uma lista completa de formatos, efeitos e outras características, visite esta página (em Inglês).

Instalação

Versões para Windows e Mac podem ser baixadas diretamente da página oficial de download. Para Linux, o SoX pode ser compilado do código-fonte (disponível na mesma página), ou instalado via repositórios de pacotes para distribuições específicas. No caso do Slackware (a distribuição Linux que eu uso), ele é instalado por padrão embora o suporte a geração de arquivos MP3 venha desabilitado, o que pode ser resolvido apenas executando novamente o script (SlackBuild) para compilá-lo, depois reinstalá-lo.

Programas Inclusos

O SoX é uma ferramenta para linha de comando e vem com alguns mini programas (comandos) para execução de diferentes tarefas:

Play

Reproduz arquivos de áudio nos formatos suportados, além de aplicar efeitos durante a reprodução caso desejado.

Rec

Grava de um dispositivo (microfone, placa de som etc) para um arquivo em um dos formatos suportados.

Soxi

Exibe informações sobre arquivos de áudio nos formatos suportados.

Sox

É comumente usado para processar arquivo (s) e salvar os resultados em outro arquivo, mas na verdade ele é o núcleo do “play”, do “rec” e do “soxi”.

Exemplos Básicos de Uso

Nota: estes exemplos foram executados no Linux, não sei se há diferenças nos comandos para outros sistemas.

Exibir Informações Sobre Arquivos

  1. Exibe informações como tamanho, duração, codificação, taxa de bits (bitrate), número de canais, taxa de amostragem (sample rate), comentários etc. de um arquivo chamado “musica.mp3”:$ soxi musica.mp3
  2. Exibe apenas a duração do arquivo acima:$ soxi -d musica.mp3

Reproduzindo Arquivos

  1. Toca um arquivo chamado “exemplo.mp3”:$ play exemplo.mp3
  2. Toca um arquivo chamado “exemplo.mp3” com um efeito de reverberação (reverb):$ play exemplo.mp3 reverb
  3. Reproduz o arquivo “exemplo.mp3” de trás para frente:$ play exemplo.mp3 reverse
  4. Reproduz apenas os primeiros cinco segundos de “exemplo.mp3”:$ play exemplo.mp3 trim 0 5
  5. Toca o arquivo “exemplo.mp3”, do quinto segundo em diante:$ play exemplo.mp3 trim 5

Nota: existem opções para controlar os parâmetros de reverb, trim etc., bem como vários outros efeitos. Leia a seção “Obtendo Ajuda” abaixo para mais informações.

Gravando

Captura o som do dispositivo de gravação padrão (por exemplo, um microfone) e salva em um arquivo chamado “exemplo.wav”:

Nota: primeiro você precisa definir o dispositivo de gravação (por exemplo, nas configurações de som no Windows, ou com programas como “alsamixer” ou “aumix” no Linux).

Pausando e Continuando

Para pausar a reprodução ou gravação, pressione Ctrl-z. O SoX vai pausar e ficar em segundo plano (background). Para retomar de onde parou e colocá-lo novamente em primeiro plano (foreground), digite o comando:

Nota: não sei se isso funciona da mesma forma (nem como/se funciona) no Windows.

Processamento e Conversão de arquivos

Estes comandos processam arquivo(s) e salvam o resultado em outro arquivo, até mesmo convertendo-o para outro formato.

  1. Converte um arquivo chamado “exemplo.wav” para “exemplo.mp3”:$ sox exemplo.wav exemplo.mp3
  2. Aplica um efeito de reverb (com os parâmetros padrões do SoX) ao arquivo “exemplo1.wav” e salva o resultado em “exemplo2.wav”:$ sox exemplo1.wav exemplo2.wav reverb
  3. Une os arquivos “exemplo-parte1.flac” e “exemplo-parte2.flac” para formar “exemplo-completo.flac”:$ sox exemplo-parte1.flac exemplo-parte2.flac exemplo-completo.flac
  4. Salva os primeiros cinquenta segundos de “exemplo1.mp3” para “exemplo2.ogg”:$ sox exemplo1.mp3 exemplo2.ogg trim 0 50
  5. Mescla (para que toquem simultaneamente) uma música de fundo (“musica.mp3”) com uma gravação de voz (“discurso.wav”), produzindo “apresentacao.ogg”:$ sox -m musica.mp3 discurso.wav apresentacao.ogg
  6. Mescla o fundo (“musica.mp3”) na metade do volume e a voz (“discurso.wav”) com o dobro de volume, produzindo “apresentacao.ogg”:$ sox -m -v0.5 musica.mp3 -v2 discurso.wav apresentacao.ogg

Dica: se quiser “pré-visualizar” (ou seria “pré-ouvir”?) os efeitos sem alterar o arquivo, você pode usar o “play” para aplicar os efeitos e ouvir:

Ajuste os parâmetros (neste exemplo, o volume, que é o número após a opção “-v”) até encontrar os valores que julgar apropriados, então substitua o comando “play” por “sox” e especifique um arquivo de saída. Exemplo:

Gerando Áudio

O SoX também pode gerar algumas formas básicas de áudio como ondas senoidais (sine waves), triangulares (triangular waves), quadradas (square waves) e “dente de serra” (sawtoot waves), além de algumas outras coisas como ruído “branco” (“white” noise), “marrom” (“brown” noise) e “rosa” (“pink” noise).

  1. Este comando reproduz uma onda senoidal em 440Hz (a nota Lá/A4) durante um segundo. O ganho (e volume do som) é diminuído para não ficar muito alto:$ play -n synth 1 sine 440 gain -10
  2. Este faz a mesma coisa, mas usa o nome da nota em vez da frequência:$ play -n synth 1 sine A4 gain -10
  3. Este outro comando salva o som para um arquivo chamado “senoide.wav” em vez de tocá-lo:$ sox -n senoide.wav synth 1 sine A4 gain -10

Suprimindo Informações

Se a quantidade de texto exibida na tela incomodar, você pode usar a opção “-q” para que o SoX não exiba nenhuma informação, exceto alertas e erros. Isso funciona tanto com o “play”, quanto com o “rec” e o “sox”. Exemplo:

Obtendo Ajuda

Para mostrar todos os comandos do SoX, formatos e efeitos, digite:

Para “play”, “rec” e “soxi”, digite “play –help”, “rec –help” e “soxi –help”, respectivamente.

Nota: a ajuda é praticamente a mesma para o “sox”, o “play” e o “rec”, exceto pela ordem dos arquivos de entrada/saída e efeitos.

Há também os manuais do usuário (em Inglês), com explicações mais detalhadas dos comandos, parâmetros de efeito e exemplos. No Linux, se os manuais estiverem instalados, você pode lê-los offline digitando

para os manuais do “sox”, do “play” e do “rec”,

para todas as opções relacionadas aos formatos de arquivo suportados e

para o manual do “soxi”. Há também o

para aqueles que querem mexer com código e a biblioteca da engine do SoX.

Você também pode ler os manuais online na página de documentação do SoX.

Links Externos

Site oficial do SoX (em Inglês)

 

Fonte: http://aiyumi.warpstar.net/pt/blog/sox-basic-intro

Oi mundo

Perdi 2 anos de posts por causa que o antigo site administrador de dominios não me notificou do vencimento do gustavofranco.com agora coloquei no uol que é mais sério as vezes vc quer economizar 10pila por ano e da essas merdas….

A “empresa” se é que posso chamar assim é o www.superdominios.org fiquem longe desse site, acho até que eles roubam dominios para revender aos donos… palhaçada total.

Gustavo Franco Pabx – Linux – Cisco – Juniper – Asterisk – VoIP – Redes – Telefonia