diff --git a/dev/assets/documenter.js b/dev/assets/documenter.js index a1ada46..6adfbbb 100644 --- a/dev/assets/documenter.js +++ b/dev/assets/documenter.js @@ -1,15 +1,15 @@ // Generated by Documenter.jl requirejs.config({ paths: { - 'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/julia.min', + 'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/languages/julia.min', 'headroom': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/headroom.min', 'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min', - 'katex-auto-render': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/contrib/auto-render.min', + 'katex-auto-render': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/contrib/auto-render.min', 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min', 'headroom-jquery': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/jQuery.headroom.min', - 'katex': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min', - 'highlight': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/highlight.min', - 'highlight-julia-repl': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/julia-repl.min', + 'katex': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min', + 'highlight': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min', + 'highlight-julia-repl': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/languages/julia-repl.min', }, shim: { "highlight-julia": { @@ -283,6 +283,12 @@ require(['jquery'], function($) { // update the version selector with info from the siteinfo.js and ../versions.js files $(document).ready(function() { + // If the version selector is disabled with DOCUMENTER_VERSION_SELECTOR_DISABLED in the + // siteinfo.js file, we just return immediately and not display the version selector. + if (typeof DOCUMENTER_VERSION_SELECTOR_DISABLED === 'boolean' && DOCUMENTER_VERSION_SELECTOR_DISABLED) { + return; + } + var version_selector = $("#documenter .docs-version-selector"); var version_selector_select = $("#documenter .docs-version-selector select"); diff --git a/dev/assets/search.js b/dev/assets/search.js index 1a51454..c133f74 100644 --- a/dev/assets/search.js +++ b/dev/assets/search.js @@ -188,6 +188,8 @@ $(document).ready(function() { searchresults = $('#documenter-search-results'); searchinfo = $('#documenter-search-info'); searchbox = $('#documenter-search-query'); + searchform = $('.docs-search'); + sidebar = $('.docs-sidebar'); function update_search(querystring) { tokens = lunr.tokenizer(querystring) results = index.query(function (q) { @@ -239,6 +241,20 @@ $(document).ready(function() { searchbox.keyup(_.debounce(update_search_box, 250)) searchbox.change(update_search_box) + // Disable enter-key form submission for the searchbox on the search page + // and just re-run search rather than refresh the whole page. + searchform.keypress( + function(event){ + if (event.which == '13') { + if (sidebar.hasClass('visible')) { + sidebar.removeClass('visible'); + } + update_search_box(); + event.preventDefault(); + } + } + ); + search_query_uri = parseUri(window.location).queryKey["q"] if(search_query_uri !== undefined) { search_query = decodeURIComponent(search_query_uri.replace(/\+/g, '%20')) diff --git a/dev/assets/themes/documenter-dark.css b/dev/assets/themes/documenter-dark.css index 3608141..0bf1af7 100644 --- a/dev/assets/themes/documenter-dark.css +++ b/dev/assets/themes/documenter-dark.css @@ -3598,7 +3598,7 @@ html.theme--documenter-dark { position: relative; } html.theme--documenter-dark .card-content { background-color: transparent; - padding: 1rem 1.25rem; } + padding: 1.5rem; } html.theme--documenter-dark .card-footer { background-color: transparent; border-top: 1px solid #5e6d6f; @@ -3938,7 +3938,7 @@ html.theme--documenter-dark { font-weight: 700; justify-content: space-between; line-height: 1.25; - padding: 0.75em; + padding: 0.75em 1em; position: relative; } html.theme--documenter-dark .message-header .delete { flex-grow: 0; @@ -3954,7 +3954,7 @@ html.theme--documenter-dark { border-style: solid; border-width: 0 0 0 4px; color: #fff; - padding: 1em 1.25em; } + padding: 1.25em 1.5em; } html.theme--documenter-dark .message-body code, html.theme--documenter-dark .message-body pre { background-color: white; } @@ -7090,13 +7090,13 @@ html.theme--documenter-dark { position: relative; overflow: hidden; } html.theme--documenter-dark pre code, html.theme--documenter-dark pre code.hljs { - padding: 0 0.5rem !important; + padding: 0 0.75rem !important; overflow: auto; display: block; } html.theme--documenter-dark pre code:first-of-type, html.theme--documenter-dark pre code.hljs:first-of-type { - padding-top: 0.7rem !important; } + padding-top: 0.5rem !important; } html.theme--documenter-dark pre code:last-of-type, html.theme--documenter-dark pre code.hljs:last-of-type { - padding-bottom: 0.7rem !important; } + padding-bottom: 0.5rem !important; } html.theme--documenter-dark pre .copy-button { opacity: 0.2; transition: opacity 0.2s; @@ -7175,16 +7175,16 @@ html.theme--documenter-dark { font-weight: 700; justify-content: space-between; line-height: 1.25; - padding: 0.75em; + padding: 0.5rem 0.75rem; position: relative; } html.theme--documenter-dark .admonition-header:before { font-family: "Font Awesome 5 Free"; font-weight: 900; - margin-right: 0.75em; + margin-right: 0.75rem; content: "\f06a"; } html.theme--documenter-dark .admonition-body { color: #fff; - padding: 1em 1.25em; } + padding: 0.5rem 0.75rem; } html.theme--documenter-dark .admonition-body pre { background-color: #282f2f; } html.theme--documenter-dark .admonition-body code { @@ -7199,7 +7199,7 @@ html.theme--documenter-dark { display: flex; flex-grow: 1; align-items: stretch; - padding: 0.75rem; + padding: 0.5rem 0.75rem; background-color: #282f2f; box-shadow: 0 1px 2px rgba(10, 10, 10, 0.1); box-shadow: none; @@ -7212,7 +7212,7 @@ html.theme--documenter-dark { margin-left: 0.3em; } html.theme--documenter-dark .docstring > section { position: relative; - padding: 1rem 1.25rem; + padding: 0.75rem 0.75rem; border-bottom: 1px solid #5e6d6f; } html.theme--documenter-dark .docstring > section:last-child { border-bottom: none; } @@ -7220,8 +7220,8 @@ html.theme--documenter-dark { transition: opacity 0.3s; opacity: 0; position: absolute; - right: 0.625rem; - bottom: 0.5rem; } + right: 0.375rem; + bottom: 0.375rem; } html.theme--documenter-dark .docstring > section > a.docs-sourcelink:focus { opacity: 1 !important; } html.theme--documenter-dark .docstring:hover > section > a.docs-sourcelink { diff --git a/dev/assets/themes/documenter-light.css b/dev/assets/themes/documenter-light.css index f3e70f4..9595d5b 100644 --- a/dev/assets/themes/documenter-light.css +++ b/dev/assets/themes/documenter-light.css @@ -3666,7 +3666,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { .card-content { background-color: transparent; - padding: 1rem 1.25rem; } + padding: 1.5rem; } .card-footer { background-color: transparent; @@ -4029,7 +4029,7 @@ a.list-item { font-weight: 700; justify-content: space-between; line-height: 1.25; - padding: 0.75em; + padding: 0.75em 1em; position: relative; } .message-header .delete { flex-grow: 0; @@ -4046,7 +4046,7 @@ a.list-item { border-style: solid; border-width: 0 0 0 4px; color: #222222; - padding: 1em 1.25em; } + padding: 1.25em 1.5em; } .message-body code, .message-body pre { background-color: white; } @@ -7004,13 +7004,13 @@ pre { position: relative; overflow: hidden; } pre code, pre code.hljs { - padding: 0 0.5rem !important; + padding: 0 0.75rem !important; overflow: auto; display: block; } pre code:first-of-type, pre code.hljs:first-of-type { - padding-top: 0.7rem !important; } + padding-top: 0.5rem !important; } pre code:last-of-type, pre code.hljs:last-of-type { - padding-bottom: 0.7rem !important; } + padding-bottom: 0.5rem !important; } pre .copy-button { opacity: 0.2; transition: opacity 0.2s; @@ -7110,17 +7110,17 @@ pre { font-weight: 700; justify-content: space-between; line-height: 1.25; - padding: 0.75em; + padding: 0.5rem 0.75rem; position: relative; } .admonition-header:before { font-family: "Font Awesome 5 Free"; font-weight: 900; - margin-right: 0.75em; + margin-right: 0.75rem; content: "\f06a"; } .admonition-body { color: #222222; - padding: 1em 1.25em; } + padding: 0.5rem 0.75rem; } .admonition-body pre { background-color: whitesmoke; } .admonition-body code { @@ -7136,7 +7136,7 @@ pre { display: flex; flex-grow: 1; align-items: stretch; - padding: 0.75rem; + padding: 0.5rem 0.75rem; background-color: whitesmoke; box-shadow: 0 1px 2px rgba(10, 10, 10, 0.1); box-shadow: none; @@ -7149,7 +7149,7 @@ pre { margin-left: 0.3em; } .docstring > section { position: relative; - padding: 1rem 1.25rem; + padding: 0.75rem 0.75rem; border-bottom: 1px solid #dbdbdb; } .docstring > section:last-child { border-bottom: none; } @@ -7157,8 +7157,8 @@ pre { transition: opacity 0.3s; opacity: 0; position: absolute; - right: 0.625rem; - bottom: 0.5rem; } + right: 0.375rem; + bottom: 0.375rem; } .docstring > section > a.docs-sourcelink:focus { opacity: 1 !important; } .docstring:hover > section > a.docs-sourcelink { diff --git a/dev/assets/warner.js b/dev/assets/warner.js index e818482..5531c88 100644 --- a/dev/assets/warner.js +++ b/dev/assets/warner.js @@ -37,7 +37,7 @@ function maybeAddWarning () { document.body.removeChild(div); }); const href = window.documenterBaseURL + '/../' + window.DOCUMENTER_STABLE; - div.innerHTML = 'This documentation is not for the latest version.
Go to the latest documentation.'; + div.innerHTML = 'This documentation is not for the latest stable release, but for either the development version or an older release.
Click here to go to the documentation for the latest stable release.'; div.appendChild(closer); document.body.appendChild(div); }; diff --git a/dev/index.html b/dev/index.html index 2328c60..767dca1 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,5 +1,5 @@ -Public interface · PortAudio.jl

Public interface

PortAudio.PortAudioStreamType
PortAudioStream(input_channels = 2, output_channels = 2; options...)
+Public interface · PortAudio.jl

Public interface

PortAudio.PortAudioStreamType
PortAudioStream(input_channels = 2, output_channels = 2; options...)
 PortAudioStream(duplex_device, input_channels = 2, output_channels = 2; options...)
 PortAudioStream(input_device, output_device, input_channels = 2, output_channels = 2; options...)

Audio devices can either be PortAudioDevice instances as returned by devices, or strings with the device name as reported by the operating system. Set input_channels to 0 for an output only stream; set output_channels to 0 for an input only steam. If you pass the function maximum instead of a number of channels, use the maximum channels allowed by the corresponding device. If a single duplex_device is given, it will be used for both input and output. If no devices are given, the system default devices will be used.

The PortAudioStream type supports all the stream and buffer features defined SampledSignals.jl by default. For example, if you load SampledSignals with using SampledSignals you can read 5 seconds to a buffer with buf = read(stream, 5s), regardless of the sample rate of the device. write(stream, stream) will set up a loopback that will read from the input and play it back on the output.

Options:

  • adjust_channels = false: If set to true, if either input_channels or output_channels exceeds the corresponding device maximum, adjust down to the maximum.
  • call_back = C_NULL: The PortAudio call-back function. Currently, passing anything except C_NULL is unsupported.
  • eltype = Float32: Sample type of the audio stream
  • flags = PortAudio.paNoFlag: PortAudio flags
  • frames_per_buffer = 128: the number of frames per buffer
  • input_info = C_NULL: host API specific stream info for the input device. Currently, passing anything except C_NULL is unsupported.
  • latency = nothing: Requested latency. Stream could underrun when too low, consider using the defaults. If left as nothing, use the defaults below:
    • For input/output only streams, use the corresponding device's default high latency.
    • For duplex streams, use the max of the default high latency of the input and output devices.
  • output_info = C_NULL: host API specific stream info for the output device. Currently, passing anything except C_NULL is unsupported.
  • reader = PortAudio.SampledSignalsReader(): the scribe that will read input. Defaults to a PortAudio.SampledSignalsReader. Users can pass custom scribes; see PortAudio.Scribe.
  • samplerate = nothing: Sample rate. If left as nothing, use the defaults below:
    • For input/output only streams, use the corresponding device's default sample rate.
    • For duplex streams, use the default sample rate if the default sample rates for the input and output devices match, otherwise throw an error.
  • warn_xruns = true: Display a warning if there is a stream overrun or underrun, which often happens when Julia is compiling, or with a particularly large GC run. Only affects duplex streams.
  • writer = PortAudio.SampledSignalsWriter(): the scribe that will write output. Defaults to a PortAudio.SampledSignalsReader. Users can pass custom scribes; see PortAudio.Scribe.

Examples:

Set up an audio pass-through from microphone to speaker

julia> using PortAudio, SampledSignals
 
@@ -24,4 +24,4 @@ julia> PortAudioStream(2, 0; warn_xruns = false) do stream
             buf = read(stream, 10s)
             save(joinpath(tempname(), ".ogg"), buf)
         end
-2 s
source
PortAudio.devicesMethod
devices()

List the devices available on your system. Devices will be shown with their internal name, and maximum input and output channels.

source
+2 s
source
PortAudio.devicesMethod
devices()

List the devices available on your system. Devices will be shown with their internal name, and maximum input and output channels.

source
diff --git a/dev/internals/index.html b/dev/internals/index.html index 81db2ac..7d97b12 100644 --- a/dev/internals/index.html +++ b/dev/internals/index.html @@ -1,2 +1,2 @@ -Internals · PortAudio.jl

Internals

PortAudio.MessengerType
Messenger{Sample, Scribe, Input, Output}

A struct with entries

  • device_name::String
  • buffer::Buffer{Sample}
  • scribe::Scribe
  • input_channel::Channel{Input}
  • output_channel::Channel{Output}

The messenger will send tasks to the scribe; the scribe will read/write from the buffer.

source
+Internals · PortAudio.jl

Internals

PortAudio.MessengerType
Messenger{Sample, Scribe, Input, Output}

A struct with entries

  • device_name::String
  • buffer::Buffer{Sample}
  • scribe::Scribe
  • input_channel::Channel{Input}
  • output_channel::Channel{Output}

The messenger will send tasks to the scribe; the scribe will read/write from the buffer.

source
PortAudio.read_buffer!Function
PortAudio.read_buffer!(buffer::Buffer, use_frames = buffer.frames_per_buffer; acquire_lock = true)

Read a number of frames (use_frames) from PortAudio to a PortAudio.Buffer.

Set acquire_lock = false to skip acquiring the acquire_lock.

source
PortAudio.write_bufferFunction
PortAudio.write_buffer(buffer, use_frames = buffer.frames_per_buffer; acquire_lock = true)

Write a number of frames (use_frames) from a PortAudio.Buffer to PortAudio.

Set acquire_lock = false to skip acquiring the lock.

source
diff --git a/dev/search/index.html b/dev/search/index.html index a61f085..f7cafc9 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · PortAudio.jl

Loading search...

    +Search · PortAudio.jl

    Loading search...

      diff --git a/dev/search_index.js b/dev/search_index.js index 088601d..0716638 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"#Public-interface","page":"Public interface","title":"Public interface","text":"","category":"section"},{"location":"","page":"Public interface","title":"Public interface","text":"Pages = [\"index.md\"]","category":"page"},{"location":"","page":"Public interface","title":"Public interface","text":"Modules = [PortAudio]\nPrivate = false","category":"page"},{"location":"#PortAudio.PortAudioStream","page":"Public interface","title":"PortAudio.PortAudioStream","text":"PortAudioStream(input_channels = 2, output_channels = 2; options...)\nPortAudioStream(duplex_device, input_channels = 2, output_channels = 2; options...)\nPortAudioStream(input_device, output_device, input_channels = 2, output_channels = 2; options...)\n\nAudio devices can either be PortAudioDevice instances as returned by devices, or strings with the device name as reported by the operating system. Set input_channels to 0 for an output only stream; set output_channels to 0 for an input only steam. If you pass the function maximum instead of a number of channels, use the maximum channels allowed by the corresponding device. If a single duplex_device is given, it will be used for both input and output. If no devices are given, the system default devices will be used.\n\nThe PortAudioStream type supports all the stream and buffer features defined SampledSignals.jl by default. For example, if you load SampledSignals with using SampledSignals you can read 5 seconds to a buffer with buf = read(stream, 5s), regardless of the sample rate of the device. write(stream, stream) will set up a loopback that will read from the input and play it back on the output.\n\nOptions:\n\nadjust_channels = false: If set to true, if either input_channels or output_channels exceeds the corresponding device maximum, adjust down to the maximum.\ncall_back = C_NULL: The PortAudio call-back function. Currently, passing anything except C_NULL is unsupported.\neltype = Float32: Sample type of the audio stream\nflags = PortAudio.paNoFlag: PortAudio flags\nframes_per_buffer = 128: the number of frames per buffer\ninput_info = C_NULL: host API specific stream info for the input device. Currently, passing anything except C_NULL is unsupported.\nlatency = nothing: Requested latency. Stream could underrun when too low, consider using the defaults. If left as nothing, use the defaults below:\nFor input/output only streams, use the corresponding device's default high latency.\nFor duplex streams, use the max of the default high latency of the input and output devices.\noutput_info = C_NULL: host API specific stream info for the output device. Currently, passing anything except C_NULL is unsupported.\nreader = PortAudio.SampledSignalsReader(): the scribe that will read input. Defaults to a PortAudio.SampledSignalsReader. Users can pass custom scribes; see PortAudio.Scribe.\nsamplerate = nothing: Sample rate. If left as nothing, use the defaults below:\nFor input/output only streams, use the corresponding device's default sample rate.\nFor duplex streams, use the default sample rate if the default sample rates for the input and output devices match, otherwise throw an error.\nwarn_xruns = true: Display a warning if there is a stream overrun or underrun, which often happens when Julia is compiling, or with a particularly large GC run. Only affects duplex streams.\nwriter = PortAudio.SampledSignalsWriter(): the scribe that will write output. Defaults to a PortAudio.SampledSignalsReader. Users can pass custom scribes; see PortAudio.Scribe.\n\nExamples:\n\nSet up an audio pass-through from microphone to speaker\n\njulia> using PortAudio, SampledSignals\n\njulia> stream = PortAudioStream(2, 2; warn_xruns = false);\n\njulia> try\n # cancel with Ctrl-C\n write(stream, stream, 2s)\n finally\n close(stream)\n end\n\nUse do syntax to auto-close the stream\n\njulia> using PortAudio, SampledSignals\n\njulia> PortAudioStream(2, 2; warn_xruns = false) do stream\n write(stream, stream, 2s)\n end\n\nOpen devices by name\n\nusing PortAudio, SampledSignals\nPortAudioStream(\"Built-in Microph\", \"Built-in Output\"; warn_xruns = false) do stream\n write(stream, stream, 2s)\nend\n2 s\n\nRecord 10 seconds of audio and save to an ogg file\n\njulia> using PortAudio, SampledSignals, LibSndFile\n\njulia> PortAudioStream(2, 0; warn_xruns = false) do stream\n buf = read(stream, 10s)\n save(joinpath(tempname(), \".ogg\"), buf)\n end\n2 s\n\n\n\n\n\n","category":"type"},{"location":"#PortAudio.devices-Tuple{}","page":"Public interface","title":"PortAudio.devices","text":"devices()\n\nList the devices available on your system. Devices will be shown with their internal name, and maximum input and output channels.\n\n\n\n\n\n","category":"method"},{"location":"internals/#Internals","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"internals/","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]","category":"page"},{"location":"internals/","page":"Internals","title":"Internals","text":"Modules = [PortAudio]\nPublic = false","category":"page"},{"location":"internals/#PortAudio.Buffer","page":"Internals","title":"PortAudio.Buffer","text":"struct PortAudio.Buffer{Sample}\n\nA PortAudio.Buffer contains everything you might need to read or write data from or to PortAudio. The data field contains the raw data in the buffer. Use PortAudio.write_buffer to write data to PortAudio, and PortAudio.read_buffer! to read data from PortAudio.\n\n\n\n\n\n","category":"type"},{"location":"internals/#PortAudio.Messenger","page":"Internals","title":"PortAudio.Messenger","text":"Messenger{Sample, Scribe, Input, Output}\n\nA struct with entries\n\ndevice_name::String\nbuffer::Buffer{Sample}\nscribe::Scribe\ninput_channel::Channel{Input}\noutput_channel::Channel{Output}\n\nThe messenger will send tasks to the scribe; the scribe will read/write from the buffer.\n\n\n\n\n\n","category":"type"},{"location":"internals/#PortAudio.SampledSignalsReader","page":"Internals","title":"PortAudio.SampledSignalsReader","text":"struct PortAudio.SampledSignalsReader\n\nA PortAudio.Scribe that will use the SampledSignals package to manage reading data from PortAudio.\n\n\n\n\n\n","category":"type"},{"location":"internals/#PortAudio.SampledSignalsWriter","page":"Internals","title":"PortAudio.SampledSignalsWriter","text":"struct PortAudio.SampledSignalsReader\n\nA PortAudio.Scribe that will use the SampledSignals package to manage writing data to PortAudio.\n\n\n\n\n\n","category":"type"},{"location":"internals/#PortAudio.Scribe","page":"Internals","title":"PortAudio.Scribe","text":"abstract type PortAudio.Scribe end\n\nA scribe must implement the following:\n\nA method for PortAudio.get_input_type\nA method for PortAudio.get_output_type\nA method to call itself on two arguments: a PortAudio.Buffer and an input of the input type. This method must return an output of the output type. This method should make use of PortAudio.read_buffer! and PortAudio.write_buffer.\n\n\n\n\n\n","category":"type"},{"location":"internals/#PortAudio.get_input_type-Tuple{PortAudio.SampledSignalsScribe, Any}","page":"Internals","title":"PortAudio.get_input_type","text":"PortAudio.get_input_type(scribe::PortAudio.Scribe, Sample)\n\nGet the input type of a PortAudio.Scribe for samples of type Sample.\n\n\n\n\n\n","category":"method"},{"location":"internals/#PortAudio.get_output_type-Tuple{PortAudio.SampledSignalsScribe, Any}","page":"Internals","title":"PortAudio.get_output_type","text":"PortAudio.get_input_type(scribe::PortAudio.Scribe, Sample)\n\nGet the output type of a PortAudio.Scribe for samples of type Sample.\n\n\n\n\n\n","category":"method"},{"location":"internals/#PortAudio.read_buffer!","page":"Internals","title":"PortAudio.read_buffer!","text":"PortAudio.read_buffer!(buffer::Buffer, use_frames = buffer.frames_per_buffer)\n\nRead a number of frames (use_frames) from PortAudio to a PortAudio.Buffer.\n\n\n\n\n\n","category":"function"},{"location":"internals/#PortAudio.write_buffer","page":"Internals","title":"PortAudio.write_buffer","text":"PortAudio.write_buffer(buffer, use_frames = buffer.frames_per_buffer)\n\nWrite a number of frames (use_frames) from a PortAudio.Buffer to PortAudio.\n\n\n\n\n\n","category":"function"}] +[{"location":"#Public-interface","page":"Public interface","title":"Public interface","text":"","category":"section"},{"location":"","page":"Public interface","title":"Public interface","text":"Pages = [\"index.md\"]","category":"page"},{"location":"","page":"Public interface","title":"Public interface","text":"Modules = [PortAudio]\nPrivate = false","category":"page"},{"location":"#PortAudio.PortAudioStream","page":"Public interface","title":"PortAudio.PortAudioStream","text":"PortAudioStream(input_channels = 2, output_channels = 2; options...)\nPortAudioStream(duplex_device, input_channels = 2, output_channels = 2; options...)\nPortAudioStream(input_device, output_device, input_channels = 2, output_channels = 2; options...)\n\nAudio devices can either be PortAudioDevice instances as returned by devices, or strings with the device name as reported by the operating system. Set input_channels to 0 for an output only stream; set output_channels to 0 for an input only steam. If you pass the function maximum instead of a number of channels, use the maximum channels allowed by the corresponding device. If a single duplex_device is given, it will be used for both input and output. If no devices are given, the system default devices will be used.\n\nThe PortAudioStream type supports all the stream and buffer features defined SampledSignals.jl by default. For example, if you load SampledSignals with using SampledSignals you can read 5 seconds to a buffer with buf = read(stream, 5s), regardless of the sample rate of the device. write(stream, stream) will set up a loopback that will read from the input and play it back on the output.\n\nOptions:\n\nadjust_channels = false: If set to true, if either input_channels or output_channels exceeds the corresponding device maximum, adjust down to the maximum.\ncall_back = C_NULL: The PortAudio call-back function. Currently, passing anything except C_NULL is unsupported.\neltype = Float32: Sample type of the audio stream\nflags = PortAudio.paNoFlag: PortAudio flags\nframes_per_buffer = 128: the number of frames per buffer\ninput_info = C_NULL: host API specific stream info for the input device. Currently, passing anything except C_NULL is unsupported.\nlatency = nothing: Requested latency. Stream could underrun when too low, consider using the defaults. If left as nothing, use the defaults below:\nFor input/output only streams, use the corresponding device's default high latency.\nFor duplex streams, use the max of the default high latency of the input and output devices.\noutput_info = C_NULL: host API specific stream info for the output device. Currently, passing anything except C_NULL is unsupported.\nreader = PortAudio.SampledSignalsReader(): the scribe that will read input. Defaults to a PortAudio.SampledSignalsReader. Users can pass custom scribes; see PortAudio.Scribe.\nsamplerate = nothing: Sample rate. If left as nothing, use the defaults below:\nFor input/output only streams, use the corresponding device's default sample rate.\nFor duplex streams, use the default sample rate if the default sample rates for the input and output devices match, otherwise throw an error.\nwarn_xruns = true: Display a warning if there is a stream overrun or underrun, which often happens when Julia is compiling, or with a particularly large GC run. Only affects duplex streams.\nwriter = PortAudio.SampledSignalsWriter(): the scribe that will write output. Defaults to a PortAudio.SampledSignalsReader. Users can pass custom scribes; see PortAudio.Scribe.\n\nExamples:\n\nSet up an audio pass-through from microphone to speaker\n\njulia> using PortAudio, SampledSignals\n\njulia> stream = PortAudioStream(2, 2; warn_xruns = false);\n\njulia> try\n # cancel with Ctrl-C\n write(stream, stream, 2s)\n finally\n close(stream)\n end\n\nUse do syntax to auto-close the stream\n\njulia> using PortAudio, SampledSignals\n\njulia> PortAudioStream(2, 2; warn_xruns = false) do stream\n write(stream, stream, 2s)\n end\n\nOpen devices by name\n\nusing PortAudio, SampledSignals\nPortAudioStream(\"Built-in Microph\", \"Built-in Output\"; warn_xruns = false) do stream\n write(stream, stream, 2s)\nend\n2 s\n\nRecord 10 seconds of audio and save to an ogg file\n\njulia> using PortAudio, SampledSignals, LibSndFile\n\njulia> PortAudioStream(2, 0; warn_xruns = false) do stream\n buf = read(stream, 10s)\n save(joinpath(tempname(), \".ogg\"), buf)\n end\n2 s\n\n\n\n\n\n","category":"type"},{"location":"#PortAudio.devices-Tuple{}","page":"Public interface","title":"PortAudio.devices","text":"devices()\n\nList the devices available on your system. Devices will be shown with their internal name, and maximum input and output channels.\n\n\n\n\n\n","category":"method"},{"location":"internals/#Internals","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"internals/","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]","category":"page"},{"location":"internals/","page":"Internals","title":"Internals","text":"Modules = [PortAudio]\nPublic = false","category":"page"},{"location":"internals/#PortAudio.Buffer","page":"Internals","title":"PortAudio.Buffer","text":"struct PortAudio.Buffer{Sample}\n\nA PortAudio.Buffer contains everything you might need to read or write data from or to PortAudio. The data field contains the raw data in the buffer. Use PortAudio.write_buffer to write data to PortAudio, and PortAudio.read_buffer! to read data from PortAudio.\n\n\n\n\n\n","category":"type"},{"location":"internals/#PortAudio.Messenger","page":"Internals","title":"PortAudio.Messenger","text":"Messenger{Sample, Scribe, Input, Output}\n\nA struct with entries\n\ndevice_name::String\nbuffer::Buffer{Sample}\nscribe::Scribe\ninput_channel::Channel{Input}\noutput_channel::Channel{Output}\n\nThe messenger will send tasks to the scribe; the scribe will read/write from the buffer.\n\n\n\n\n\n","category":"type"},{"location":"internals/#PortAudio.SampledSignalsReader","page":"Internals","title":"PortAudio.SampledSignalsReader","text":"struct PortAudio.SampledSignalsReader\n\nA PortAudio.Scribe that will use the SampledSignals package to manage reading data from PortAudio.\n\n\n\n\n\n","category":"type"},{"location":"internals/#PortAudio.SampledSignalsWriter","page":"Internals","title":"PortAudio.SampledSignalsWriter","text":"struct PortAudio.SampledSignalsReader\n\nA PortAudio.Scribe that will use the SampledSignals package to manage writing data to PortAudio.\n\n\n\n\n\n","category":"type"},{"location":"internals/#PortAudio.Scribe","page":"Internals","title":"PortAudio.Scribe","text":"abstract type PortAudio.Scribe end\n\nA scribe must implement the following:\n\nA method for PortAudio.get_input_type\nA method for PortAudio.get_output_type\nA method to call itself on two arguments: a PortAudio.Buffer and an input of the input type. This method must return an output of the output type. This method should make use of PortAudio.read_buffer! and PortAudio.write_buffer.\n\n\n\n\n\n","category":"type"},{"location":"internals/#PortAudio.get_input_type-Tuple{PortAudio.SampledSignalsScribe, Any}","page":"Internals","title":"PortAudio.get_input_type","text":"PortAudio.get_input_type(scribe::PortAudio.Scribe, Sample)\n\nGet the input type of a PortAudio.Scribe for samples of type Sample.\n\n\n\n\n\n","category":"method"},{"location":"internals/#PortAudio.get_output_type-Tuple{PortAudio.SampledSignalsScribe, Any}","page":"Internals","title":"PortAudio.get_output_type","text":"PortAudio.get_input_type(scribe::PortAudio.Scribe, Sample)\n\nGet the output type of a PortAudio.Scribe for samples of type Sample.\n\n\n\n\n\n","category":"method"},{"location":"internals/#PortAudio.read_buffer!","page":"Internals","title":"PortAudio.read_buffer!","text":"PortAudio.read_buffer!(buffer::Buffer, use_frames = buffer.frames_per_buffer; acquire_lock = true)\n\nRead a number of frames (use_frames) from PortAudio to a PortAudio.Buffer.\n\nSet acquire_lock = false to skip acquiring the acquire_lock.\n\n\n\n\n\n","category":"function"},{"location":"internals/#PortAudio.write_buffer","page":"Internals","title":"PortAudio.write_buffer","text":"PortAudio.write_buffer(buffer, use_frames = buffer.frames_per_buffer; acquire_lock = true)\n\nWrite a number of frames (use_frames) from a PortAudio.Buffer to PortAudio.\n\nSet acquire_lock = false to skip acquiring the lock.\n\n\n\n\n\n","category":"function"}] }