Importing Audio

From Audacity Development Manual
Revision as of 19:14, 7 June 2011 by Billw58 (talk | contribs) (transfer note about Extended Import from File menu page to this page)
Jump to: navigation, search
Bill07Jun11: ToDo-2 Review and approve this page for 2.0

Audio File Formats Supported by Audacity

The "native" audio formats (importable by Audacity as shipped) are:

Gale: Don't forget MP2. The MP3 filter lists MP2 and should say so. But MP2 imports are failing unrecognised for me on Windows 7 at the moment. Needs looking into.

  • Steve wrote: Not sure how to work this in, but when importing, Audacity treats FLAC files like uncompressed audio. If "import faster" is selected, FLAC files are not copied and are dependencies.
  • Gale: Looks like a bug here. On Windows, FLAC files come in with libflac, copied in. On Linux they come in with libsndfile, so trigger the Importing Uncompressed Audio Files warning. Bill, can you initialise and say what happens on Mac?
  • Bill: On Mac with initialized cfg libflac is used, copied in.
    But FLAC is a compressed format, so the "when importing uncompresed files" header is misleading if FLAC files can be read-directly?

The optional FFmpeg library may be installed to enable import from a much larger range of audio formats (as long as the files are not protected to work only in particular software). FFmpeg will also import audio from most video files that are not DRM protected.

Audacity also supports importing Audacity's AU data files. This format should not be confused with Sun Microsystems AU files, which are usually u-law encoded PCM files but may be headerless.

Old PCM file types such as SND and AU files are normally supported provided they contain correctly formatted header information. If they do not have header information (headerless) or have non-standard header information, it may still be possible to import them as Raw Data.

Raw Data formats such as headerless AU files and Dialogic ADPCM (VOX) have no header information and must be imported using File > Import > Raw Data....

Four Ways to Import Audio

No matter which method you use to select an audio file, the file is always imported into an Audacity project. Each imported audio file appears in the Audacity project in its own track.

  • File > Open
This command will behave differently in the following situations:
  1. With no Audacity project window open, or an Audacity project window open containing (or that has ever contained) at least one track:
    If you select the File > Open command, then choose one or more audio files (as opposed to an Audacity project file), Audacity will, for each file chosen, open a new project window then import one of the selected audio files into that new project. Thus if you choose, for example, three audio files, Audacity will create three new project windows with each audio file imported into its own project.
  2. With a clean, empty Audacity project window open (one with no tracks in it and that has never contained any tracks):
    If you select the File > Open command, then choose one or more audio files, Audacity will import the first file into the empty project window, and import subsequent files into new project windows.
If you want to bring the content of one or more audio files into a project that already contains audio (for example, to mix several audio files together), use the File > Import > Audio command.
Note that you are not actually "opening" the audio file. You are "importing" it into an Audacity project. See Audacity Projects for details of the difference between audio files and Audacity projects.

Gale:As someone who understands the distinction in the first place, the above note div just confuses me. Better to attack this further up the article IMO, explaining that any of the four actions that bring audio into the project window are regarded as "importing". The point of importing in the sense of the menu item of that name is that it always brings audio into the same project.
Bill: The issue I was trying to address is users who "open" a WAV file and then wonder why they can't "save" it. I've tried it both ways for comparison. What do others think?
Peter 26Apr11: seems perfectly clear (and necessary) to me. But note that the need for this will go away if James' recent proposal incorporating the restriction of "Open" to operate only on projects and not audio files is implemented. See Menu Reorganization in the Wiki.

  • File > Recent Files (Open Recent on Mac)
This command behaves identically to File > Open.
  • File > Import > Audio
If you select the File > Import > Audio command, then choose one or more audio files, Audacity will import the selected file(s) into the existing project. This is the way to get several audio files into one project.
  • Drag and drop
    • On Windows and on Macintosh:
      • Drag and drop one or more audio files onto the Audacity icon: this is equivalent to File > Open.
      • Drag and drop one or more audio files into an open Audacity project window: this is equivalent to File > Import > Audio.
    • On Linux:
      • Drag and drop one or more audio files onto the Audacity icon: only the first file will open. More than one file dragged and dropped onto the icon will do the same as the File > Open command for the first file, but the other files will generate an error message saying that Audacity is already running.
      • Drag and drop files into an open Audacity Project window: this is equivalent to File > Import > Audio.
In all cases each imported audio file will appear in a new track in the Audacity project window.

Importing Uncompressed Audio Files

The two most common uncompressed file types you will encounter are WAV and AIF.

Peter 16Apr11: I would place the "safer" option as point 1 especially since it is now the default post 1.3.13. It's not strictly true that for the "faster" setting that "long files can be imported in ony a few seconds" as you say. It can take quite a time to get the full waveform graphic drawn - and technically you are not actually "importing" the audio, just linking to it. What you can do is start editing on the file quicker (before the full waveform is drawn) when using "faster".
Bill 16Apr11: Yes, I'm aware of those points, which were raised in a recent thread on one of the lists. The text is copied from the File menu page. Note that while the waveform is being calculated the message "Import Complete - calculating waveform" appears in the status area. I don't want to contradict what the UI says!
Steve 16Apr11: Personally I prefer "faster" as point 1. The great value of the faster option for me is that I can immediately start work. If a user has got as far as reading this page of the manual, they should be able to take full advantage of this feature safely. It's a good feature and deserves promoting. I think it also makes more sense to talk about "copying in" audio files after talking about linking to external files.

  • Gale: Yes, unfortunately, the status bar when OD importing says imports are "complete" at the point the waveform drawing starts. I said that was a contradictory use of "import" at the time... But I would say (again), let's stick to the item ordering in the Audacity buttons (mention copy in first) and use the wording on the warning (edit almost immediately).

Uncompressed files can be imported into Audacity in two ways.

  1. Make a copy before editing (safer)
    When this option is chosen Audacity makes a copy of all imported file(s). It is essential that files are copied into the project if the Audacity project is to be moved, opened on another computer, or sent to someone else. This is the default setting.
  2. Read directly from the original (faster)
    When this option is chosen Audacity always reads imported files from the computer folder you first imported them from, without copying them into the project. Therefore with this option set, you must not move, rename or delete imported uncompressed files, or the folder they are in. The advantage of this option is that you can begin editing a long file almost immediately, since On-Demand Loading will be used to import the file.

Dependencies

If you import any uncompressed audio files into your project using the "read directly" option, then your project depends on those files. At any time you can check which files your project depends on by clicking on File > Check Dependencies. See the Dependencies Dialog page for details.

When you save a project you can choose whether or not to copy dependent files into the project. See the Projects Preferences page for details.

Warning Dialog when Importing Uncompressed Audio Files

The first time you import an uncompressed audio file into Audacity, you will see this dialog.

Warning Importing Uncompressed Audio dialog

For each file selected, you can choose:

  • Which method to use to import the file.
  • Whether to make your choice permanent and never show this warning again.
You can change your import preference at any time in Import / Export Preferences, and you can turn this warning on and off in Warnings Preferences

Importing Compressed Audio Files

Some of the compressed audio file types you may encounter are MP2, MP3, Ogg Vorbis and FLAC, among others.

When you import a compressed audio file into your project it is always copied into the project.

Using the Format drop-down menu in the Open and Import Audio Dialogs

The choice made in the Format drop-down menu in these dialogs does two things.

  1. It restricts the file list to files of that type (or those supported by that importer), according to the file extension.
  2. It chooses which importer to use.

The choices in the Format drop-down menu are:

  • All files
    • All files in the list are selectable, even those not supported by Audacity or FFmpeg
    • The built-in Audacity importers will be tried first, then FFmpeg (if installed)
  • All supported files
    • Only those files supported by Audacity or FFmpeg (if installed) are selectable
    • The built-in Audacity importers will be tried first, then FFmpeg
  • Audacity Projects - This option is available only when you use the File > Open command
    • Only Audacity project files (.aup) are selectable
    • No importer is involved, since you are opening an Audacity project, not importing an audio file
  • WAV, AIF and other uncompressed types
    • Only uncompressed files are selectable
    • The built-in Audacity importers will be tried first, then FFmpeg (if installed)
  • Ogg vorbis files, FLAC files, MP3 files
    • Only files of the specified type are selectable
    • The built-in Audacity importers will be tried first, then FFmpeg (if installed)
  • List of files in basic text format
    • Only files ending in .lof are selectable. See LOF Files for how to create and use LOF files.
    • The importer used will depend on the files pointed to by the LOF file.
  • FFmpeg compatible files - this option is only available if you have installed the optional FFmpeg extension.
    • Any file types supported by FFmpeg are selectable
    • The FFmpeg importer will always be tried first if "Filter chosen in OpenFile dialog overrides any rules" in Extended Import Preferences is checked, otherwise the native importer will be tried first.
      • Note that if this option is chosen and an uncompressed file type is selected from the list, On-Demand Loading will not be used.

Gale: Due to the buggy Extended Import interaction, the native importer will be used if it's a native file, unless you have "Filter chosen in OpenFile dialog overrides any rules" checked.
Bill: Aaarrrgh! So, having no rules in Extended Import prefs is like have a rule that says "*.* - default import order"? So if the "Filter chosen ..." box is not checked then the native importer is always tried first.

But we should say somewhere on this page that whatever the rule in operation is, all methods of importing now obey that rule. That was a good outcome of LRN's changes.

  • Quicktime files - Mac only
    • Any file type supported by Quicktime is selectable
    • Quicktime will be used to decode the file and send it to Audacity

The current setting of the file-types dropdown (or the import rule set in Extended Import Preferences if "Filter chosen" is unchecked) always determines the importer that tries first to import the file. This is true irrespective of which File menu item you use to import the file(s), or whether you instead drag the file(s) into Audacity.

Interaction with the Extended Import Preferences

Steve 16Apr11: This section is confused by the fact that the first check box must be NOT selected to enable the settings. As a usability issue it would, in my opinion, be much better if this initial option were reversed in the GUI to "Enable Extended Import Rules". This would enable this documentation to be more simple, and would be easier for users to understand.
Bill 16Apr11: I agree, so would you like to raise that issue on -quality? In the meantime this documents how things currently work. Does the "if ... then" structure work?

  • Gale: Yes I have already suggested to Leland as a minimum that the checkbox should be reversed to mean that rules are always applied. But there are other ways we can do this too. Frankly I would leave most of the below out until we decide how we are going to change it. I can barely get my head round what is supposed to happen now.

Bill: It depends on how soon we want to go live with this page and how soon any improvements to Extended Import are made.

Proposed text follows ...

The Extended Import Preferences pane has a checkbox that reads "Filter chosen in OpenFile dialog overrides any rules". 'Filter' in this context means the choice made in the 'Format' drop-down menu.

If

  • there are any rules listed in the Extended Import Preferences, and
  • "Filter chosen in OpenFile dialog overrides any rules" is not checked

then

  • the importer used for a given file type will be determined by the Extended Import rules as long as that file type has a rule, otherwise the importer used will be as detailed in the list in the section above.

If

  • "Filter chosen in OpenFile dialog overrides any rules" is checked, and
  • Any choice other than "All files" or "All supported files" is made in the Format drop-down menu

then

  • the importer used will be as detailed in the list in the section above.