Initialize audio context.
548745
function() {
		this.context = new AudioContext();
		this.sampleRate = this.context.sampleRate;
		this.gainNode = this.context.createGain();
		this.gainNode.connect( this.context.destination );
	}
3848
protected function _init() {
		parent::_init();

		if (!$this->_context) {
			return;
		}
		$this->_context->strings($this->_strings);

		if ($this->_config['handlers']) {
			$this->_context->handlers($this->_config['handlers']);
		}
	}
315508
private void setupAudio() {
		audio.setAutoplay(cbAutoPlay.isSelected());
		audio.setLoop(!cbLoop.isDisabled() && cbLoop.isSelected());
		audio.setControls(cbControls.isSelected() ? WAudio.Controls.PLAY_PAUSE : WAudio.Controls.NATIVE);
		audio.setDisabled(cbControls.isSelected() && cbDisable.isSelected());
	}
702274
public OkVolley init(Context context) {
        this.mContext = context;
        InstanceRequestQueue = newRequestQueue(context);
        mUserAgent = generateUserAgent(context);
        mRequestHeaders = new HashMap<>();
        mRequestHeaders.put(OkRequest.HEADER_USER_AGENT, mUserAgent);
        mRequestHeaders.put(OkRequest.HEADER_ACCEPT_CHARSET, OkRequest.CHARSET_UTF8);
        return this;
    }
1070424
def save_context(context):
    """"""
    file_path = _get_context_filepath()
    content = format_to_http_prompt(context, excluded_options=EXCLUDED_OPTIONS)
    with io.open(file_path, 'w', encoding='utf-8') as f:
        f.write(content)
37423
@Override
	public void init(ServletContext context, JawrConfig config) {
		this.context = context;
		this.charset = config.getResourceCharset();
	}
593524
def make_context(self, **kwargs):
        """"""
        self.check_schema()
        return Context(self.driver, self.config, **kwargs)
174258
private void init(final Context context, final AttributeSet attrs) {
        if (isInEditMode())
            return;

        final TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RippleView);
        rippleColor = typedArray.getColor(R.styleable.RippleView_rv_color, getResources().getColor(R.color.rippelColor));
        rippleType = typedArray.getInt(R.styleable.RippleView_rv_type, 0);
        hasToZoom = typedArray.getBoolean(R.styleable.RippleView_rv_zoom, false);
        isCentered = typedArray.getBoolean(R.styleable.RippleView_rv_centered, false);
        rippleDuration = typedArray.getInteger(R.styleable.RippleView_rv_rippleDuration, rippleDuration);
        frameRate = typedArray.getInteger(R.styleable.RippleView_rv_framerate, frameRate);
        rippleAlpha = typedArray.getInteger(R.styleable.RippleView_rv_alpha, rippleAlpha);
        ripplePadding = typedArray.getDimensionPixelSize(R.styleable.RippleView_rv_ripplePadding, 0);
        canvasHandler = new Handler();
        zoomScale = typedArray.getFloat(R.styleable.RippleView_rv_zoomScale, 1.03f);
        zoomDuration = typedArray.getInt(R.styleable.RippleView_rv_zoomDuration, 200);
        typedArray.recycle();
        paint = new Paint();
        paint.setAntiAlias(true);
        paint.setStyle(Paint.Style.FILL);
        paint.setColor(rippleColor);
        paint.setAlpha(rippleAlpha);
        this.setWillNotDraw(false);

        gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {
            @Override
            public void onLongPress(MotionEvent event) {
                super.onLongPress(event);
                animateRipple(event);
                sendClickEvent(true);
            }

            @Override
            public boolean onSingleTapConfirmed(MotionEvent e) {
                return true;
            }

            @Override
            public boolean onSingleTapUp(MotionEvent e) {
                return true;
            }
        });

        this.setDrawingCacheEnabled(true);
        this.setClickable(true);
    }
968408
function aceInitialized(hook, context){
  var editorInfo = context.editorInfo;
  editorInfo.ace_doInsertHeading = _(doInsertHeading).bind(context);
}
1275315
private void initializePendingIntent(Context context) {

        // toggle playback
        Intent togglePlaybackIntent = new Intent(context, PlaybackService.class);
        togglePlaybackIntent.setAction(PlaybackService.ACTION_TOGGLE_PLAYBACK);
        mTogglePlaybackPendingIntent = PendingIntent.getService(context, REQUEST_CODE_PLAYBACK,
                togglePlaybackIntent, PendingIntent.FLAG_UPDATE_CURRENT);

        // next track
        Intent nextPrendingIntent = new Intent(context, PlaybackService.class);
        nextPrendingIntent.setAction(PlaybackService.ACTION_NEXT_TRACK);
        mNextPendingIntent = PendingIntent.getService(context, REQUEST_CODE_NEXT,
                nextPrendingIntent, PendingIntent.FLAG_UPDATE_CURRENT);

        // previous track
        Intent previousPendingIntent = new Intent(context, PlaybackService.class);
        previousPendingIntent.setAction(PlaybackService.ACTION_PREVIOUS_TRACK);
        mPreviousPendingIntent = PendingIntent.getService(context, REQUEST_CODE_PREVIOUS,
                previousPendingIntent, PendingIntent.FLAG_UPDATE_CURRENT);

        // clear notification
        Intent clearPendingIntent = new Intent(context, PlaybackService.class);
        clearPendingIntent.setAction(PlaybackService.ACTION_CLEAR_NOTIFICATION);
        mClearPendingIntent = PendingIntent.getService(context, REQUEST_CODE_CLEAR,
                clearPendingIntent, PendingIntent.FLAG_UPDATE_CURRENT);
    }
280070
function initialize(success, error, opts) {
    console.log("AudioInputCaptureProxy: initialize: " + JSON.stringify(opts));
    onInitialized = success;
    if (!intialized) {
        sampleRate = opts[0] || sampleRate;
        bufferSize = opts[1] || bufferSize;
        channels = opts[2] || channels;
        format = opts[3] || format;
        audioSourceType = opts[4] || audioSourceType;
        fileUrl = opts[5] || fileUrl;

        if (fileUrl) {
            window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
            if (window.webkitStorageInfo && window.webkitStorageInfo.requestQuota) {
                // Chrome/Android requires calling requestQuota first
                window.webkitStorageInfo.requestQuota(
                    /file:\/\/\/temporary.*/.test(fileUrl) ? window.TEMPORARY : window.PERSISTENT,
                    10 * 1024 * 1024,
                    function (grantedBytes) {
                        console.log("AudioInputCaptureProxy: Granted " + grantedBytes + " bytes storage");
                        window.requestFileSystem(
                            /file:\/\/\/temporary.*/.test(fileUrl) ? window.TEMPORARY : window.PERSISTENT,
                            10 * 1024 * 1024,
                            function (fs) {
                                console.log("AudioInputCaptureProxy: Got file system: " + fs.name);
                                fileSystem = fs;
                                intialized = true;
                                onInitialized();
                            }, error);
                    }, error);
            }
            else {
                // Firefox and Safari/iOS require calling requestFileSystem directly
                window.requestFileSystem(
                    /file:\/\/\/temporary.*/.test(fileUrl) ? window.TEMPORARY : window.PERSISTENT,
                    10 * 1024 * 1024,
                    function (fs) {
                        console.log("AudioInputCaptureProxy: Got file system: " + fs.name);
                        fileSystem = fs;
                        intialized = true;
                        onInitialized();
                    }, error);
            }
            return;
        } // fileUrl set
        intialized = true;
    } // !initialized
    onInitialized();
}
70058
def get_context(self, name, value, attrs):
        """"""
        context = super(CaptchaTextInput, self).get_context(name, value, attrs)
        context['image'] = self.image_url()
        context['audio'] = self.audio_url()
        return context
598339
function getAudioContext() {

        // Fallback to Webkit-specific AudioContext implementation
        var AudioContext = window.AudioContext || window.webkitAudioContext;

        // Get new AudioContext instance if Web Audio API is supported
        if (AudioContext) {
            try {

                // Create new instance if none yet exists
                if (!Guacamole.AudioContextFactory.singleton)
                    Guacamole.AudioContextFactory.singleton = new AudioContext();

                // Return singleton instance
                return Guacamole.AudioContextFactory.singleton;

            }
            catch (e) {
                // Do not use Web Audio API if not allowed by browser
            }
        }

        // Web Audio API not supported
        return null;

    }
862195
def start(self):
        """"""
        if self.stream is None:
            from pyaudio import PyAudio, paInt16
            self.pa = PyAudio()
            self.stream = self.pa.open(
                16000, 1, paInt16, True, frames_per_buffer=self.chunk_size
            )

        self._wrap_stream_read(self.stream)

        self.engine.start()
        self.running = True
        self.is_paused = False
        self.thread = Thread(target=self._handle_predictions)
        self.thread.daemon = True
        self.thread.start()
183684
public void initialize(Context context) {
    if (!isInitialized) {
      initializePicasso(context);
      initializeData(context);
      isInitialized = true;
    }
  }
497763
public void init(Context context) {
        if (!mNotFoundClassesMap.isEmpty()) {
            buildInstalledPackagesCache(context);
        }

        mPackageMonitor.register(context);
    }
77072
static void init() {
		initialContextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
		System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
				MonitoringInitialContextFactory.class.getName());
	}