github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis06_js_wasm.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  package web
     5  
     6  import (
     7  	"github.com/primecitizens/pcz/std/ffi/js"
     8  	"github.com/primecitizens/pcz/std/plat/js/web/bindings"
     9  )
    10  
    11  const (
    12  	_ BiquadFilterType = iota
    13  
    14  	BiquadFilterType_LOWPASS
    15  	BiquadFilterType_HIGHPASS
    16  	BiquadFilterType_BANDPASS
    17  	BiquadFilterType_LOWSHELF
    18  	BiquadFilterType_HIGHSHELF
    19  	BiquadFilterType_PEAKING
    20  	BiquadFilterType_NOTCH
    21  	BiquadFilterType_ALLPASS
    22  )
    23  
    24  func (BiquadFilterType) FromRef(str js.Ref) BiquadFilterType {
    25  	return BiquadFilterType(bindings.ConstOfBiquadFilterType(str))
    26  }
    27  
    28  func (x BiquadFilterType) String() (string, bool) {
    29  	switch x {
    30  	case BiquadFilterType_LOWPASS:
    31  		return "lowpass", true
    32  	case BiquadFilterType_HIGHPASS:
    33  		return "highpass", true
    34  	case BiquadFilterType_BANDPASS:
    35  		return "bandpass", true
    36  	case BiquadFilterType_LOWSHELF:
    37  		return "lowshelf", true
    38  	case BiquadFilterType_HIGHSHELF:
    39  		return "highshelf", true
    40  	case BiquadFilterType_PEAKING:
    41  		return "peaking", true
    42  	case BiquadFilterType_NOTCH:
    43  		return "notch", true
    44  	case BiquadFilterType_ALLPASS:
    45  		return "allpass", true
    46  	default:
    47  		return "", false
    48  	}
    49  }
    50  
    51  type ChannelCountMode uint32
    52  
    53  const (
    54  	_ ChannelCountMode = iota
    55  
    56  	ChannelCountMode_MAX
    57  	ChannelCountMode_CLAMPED_MAX
    58  	ChannelCountMode_EXPLICIT
    59  )
    60  
    61  func (ChannelCountMode) FromRef(str js.Ref) ChannelCountMode {
    62  	return ChannelCountMode(bindings.ConstOfChannelCountMode(str))
    63  }
    64  
    65  func (x ChannelCountMode) String() (string, bool) {
    66  	switch x {
    67  	case ChannelCountMode_MAX:
    68  		return "max", true
    69  	case ChannelCountMode_CLAMPED_MAX:
    70  		return "clamped-max", true
    71  	case ChannelCountMode_EXPLICIT:
    72  		return "explicit", true
    73  	default:
    74  		return "", false
    75  	}
    76  }
    77  
    78  type ChannelInterpretation uint32
    79  
    80  const (
    81  	_ ChannelInterpretation = iota
    82  
    83  	ChannelInterpretation_SPEAKERS
    84  	ChannelInterpretation_DISCRETE
    85  )
    86  
    87  func (ChannelInterpretation) FromRef(str js.Ref) ChannelInterpretation {
    88  	return ChannelInterpretation(bindings.ConstOfChannelInterpretation(str))
    89  }
    90  
    91  func (x ChannelInterpretation) String() (string, bool) {
    92  	switch x {
    93  	case ChannelInterpretation_SPEAKERS:
    94  		return "speakers", true
    95  	case ChannelInterpretation_DISCRETE:
    96  		return "discrete", true
    97  	default:
    98  		return "", false
    99  	}
   100  }
   101  
   102  type BiquadFilterOptions struct {
   103  	// Type is "BiquadFilterOptions.type"
   104  	//
   105  	// Optional, defaults to "lowpass".
   106  	Type BiquadFilterType
   107  	// Q is "BiquadFilterOptions.Q"
   108  	//
   109  	// Optional, defaults to 1.
   110  	//
   111  	// NOTE: FFI_USE_Q MUST be set to true to make this field effective.
   112  	Q float32
   113  	// Detune is "BiquadFilterOptions.detune"
   114  	//
   115  	// Optional, defaults to 0.
   116  	//
   117  	// NOTE: FFI_USE_Detune MUST be set to true to make this field effective.
   118  	Detune float32
   119  	// Frequency is "BiquadFilterOptions.frequency"
   120  	//
   121  	// Optional, defaults to 350.
   122  	//
   123  	// NOTE: FFI_USE_Frequency MUST be set to true to make this field effective.
   124  	Frequency float32
   125  	// Gain is "BiquadFilterOptions.gain"
   126  	//
   127  	// Optional, defaults to 0.
   128  	//
   129  	// NOTE: FFI_USE_Gain MUST be set to true to make this field effective.
   130  	Gain float32
   131  	// ChannelCount is "BiquadFilterOptions.channelCount"
   132  	//
   133  	// Optional
   134  	//
   135  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
   136  	ChannelCount uint32
   137  	// ChannelCountMode is "BiquadFilterOptions.channelCountMode"
   138  	//
   139  	// Optional
   140  	ChannelCountMode ChannelCountMode
   141  	// ChannelInterpretation is "BiquadFilterOptions.channelInterpretation"
   142  	//
   143  	// Optional
   144  	ChannelInterpretation ChannelInterpretation
   145  
   146  	FFI_USE_Q            bool // for Q.
   147  	FFI_USE_Detune       bool // for Detune.
   148  	FFI_USE_Frequency    bool // for Frequency.
   149  	FFI_USE_Gain         bool // for Gain.
   150  	FFI_USE_ChannelCount bool // for ChannelCount.
   151  
   152  	FFI_USE bool
   153  }
   154  
   155  // FromRef calls UpdateFrom and returns a BiquadFilterOptions with all fields set.
   156  func (p BiquadFilterOptions) FromRef(ref js.Ref) BiquadFilterOptions {
   157  	p.UpdateFrom(ref)
   158  	return p
   159  }
   160  
   161  // New creates a new BiquadFilterOptions in the application heap.
   162  func (p BiquadFilterOptions) New() js.Ref {
   163  	return bindings.BiquadFilterOptionsJSLoad(
   164  		js.Pointer(&p), js.True, 0,
   165  	)
   166  }
   167  
   168  // UpdateFrom copies value of all fields of the heap object to p.
   169  func (p *BiquadFilterOptions) UpdateFrom(ref js.Ref) {
   170  	bindings.BiquadFilterOptionsJSStore(
   171  		js.Pointer(p), ref,
   172  	)
   173  }
   174  
   175  // Update writes all fields of the p to the heap object referenced by ref.
   176  func (p *BiquadFilterOptions) Update(ref js.Ref) {
   177  	bindings.BiquadFilterOptionsJSLoad(
   178  		js.Pointer(p), js.False, ref,
   179  	)
   180  }
   181  
   182  // FreeMembers frees fields with heap reference, if recursive is true
   183  // free all heap references reachable from p.
   184  func (p *BiquadFilterOptions) FreeMembers(recursive bool) {
   185  }
   186  
   187  type AutomationRate uint32
   188  
   189  const (
   190  	_ AutomationRate = iota
   191  
   192  	AutomationRate_A_RATE
   193  	AutomationRate_K_RATE
   194  )
   195  
   196  func (AutomationRate) FromRef(str js.Ref) AutomationRate {
   197  	return AutomationRate(bindings.ConstOfAutomationRate(str))
   198  }
   199  
   200  func (x AutomationRate) String() (string, bool) {
   201  	switch x {
   202  	case AutomationRate_A_RATE:
   203  		return "a-rate", true
   204  	case AutomationRate_K_RATE:
   205  		return "k-rate", true
   206  	default:
   207  		return "", false
   208  	}
   209  }
   210  
   211  type AudioParam struct {
   212  	ref js.Ref
   213  }
   214  
   215  func (this AudioParam) Once() AudioParam {
   216  	this.ref.Once()
   217  	return this
   218  }
   219  
   220  func (this AudioParam) Ref() js.Ref {
   221  	return this.ref
   222  }
   223  
   224  func (this AudioParam) FromRef(ref js.Ref) AudioParam {
   225  	this.ref = ref
   226  	return this
   227  }
   228  
   229  func (this AudioParam) Free() {
   230  	this.ref.Free()
   231  }
   232  
   233  // Value returns the value of property "AudioParam.value".
   234  //
   235  // It returns ok=false if there is no such property.
   236  func (this AudioParam) Value() (ret float32, ok bool) {
   237  	ok = js.True == bindings.GetAudioParamValue(
   238  		this.ref, js.Pointer(&ret),
   239  	)
   240  	return
   241  }
   242  
   243  // SetValue sets the value of property "AudioParam.value" to val.
   244  //
   245  // It returns false if the property cannot be set.
   246  func (this AudioParam) SetValue(val float32) bool {
   247  	return js.True == bindings.SetAudioParamValue(
   248  		this.ref,
   249  		float32(val),
   250  	)
   251  }
   252  
   253  // AutomationRate returns the value of property "AudioParam.automationRate".
   254  //
   255  // It returns ok=false if there is no such property.
   256  func (this AudioParam) AutomationRate() (ret AutomationRate, ok bool) {
   257  	ok = js.True == bindings.GetAudioParamAutomationRate(
   258  		this.ref, js.Pointer(&ret),
   259  	)
   260  	return
   261  }
   262  
   263  // SetAutomationRate sets the value of property "AudioParam.automationRate" to val.
   264  //
   265  // It returns false if the property cannot be set.
   266  func (this AudioParam) SetAutomationRate(val AutomationRate) bool {
   267  	return js.True == bindings.SetAudioParamAutomationRate(
   268  		this.ref,
   269  		uint32(val),
   270  	)
   271  }
   272  
   273  // DefaultValue returns the value of property "AudioParam.defaultValue".
   274  //
   275  // It returns ok=false if there is no such property.
   276  func (this AudioParam) DefaultValue() (ret float32, ok bool) {
   277  	ok = js.True == bindings.GetAudioParamDefaultValue(
   278  		this.ref, js.Pointer(&ret),
   279  	)
   280  	return
   281  }
   282  
   283  // MinValue returns the value of property "AudioParam.minValue".
   284  //
   285  // It returns ok=false if there is no such property.
   286  func (this AudioParam) MinValue() (ret float32, ok bool) {
   287  	ok = js.True == bindings.GetAudioParamMinValue(
   288  		this.ref, js.Pointer(&ret),
   289  	)
   290  	return
   291  }
   292  
   293  // MaxValue returns the value of property "AudioParam.maxValue".
   294  //
   295  // It returns ok=false if there is no such property.
   296  func (this AudioParam) MaxValue() (ret float32, ok bool) {
   297  	ok = js.True == bindings.GetAudioParamMaxValue(
   298  		this.ref, js.Pointer(&ret),
   299  	)
   300  	return
   301  }
   302  
   303  // HasFuncSetValueAtTime returns true if the method "AudioParam.setValueAtTime" exists.
   304  func (this AudioParam) HasFuncSetValueAtTime() bool {
   305  	return js.True == bindings.HasFuncAudioParamSetValueAtTime(
   306  		this.ref,
   307  	)
   308  }
   309  
   310  // FuncSetValueAtTime returns the method "AudioParam.setValueAtTime".
   311  func (this AudioParam) FuncSetValueAtTime() (fn js.Func[func(value float32, startTime float64) AudioParam]) {
   312  	bindings.FuncAudioParamSetValueAtTime(
   313  		this.ref, js.Pointer(&fn),
   314  	)
   315  	return
   316  }
   317  
   318  // SetValueAtTime calls the method "AudioParam.setValueAtTime".
   319  func (this AudioParam) SetValueAtTime(value float32, startTime float64) (ret AudioParam) {
   320  	bindings.CallAudioParamSetValueAtTime(
   321  		this.ref, js.Pointer(&ret),
   322  		float32(value),
   323  		float64(startTime),
   324  	)
   325  
   326  	return
   327  }
   328  
   329  // TrySetValueAtTime calls the method "AudioParam.setValueAtTime"
   330  // in a try/catch block and returns (_, err, ok = false) when it went through
   331  // the catch clause.
   332  func (this AudioParam) TrySetValueAtTime(value float32, startTime float64) (ret AudioParam, exception js.Any, ok bool) {
   333  	ok = js.True == bindings.TryAudioParamSetValueAtTime(
   334  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   335  		float32(value),
   336  		float64(startTime),
   337  	)
   338  
   339  	return
   340  }
   341  
   342  // HasFuncLinearRampToValueAtTime returns true if the method "AudioParam.linearRampToValueAtTime" exists.
   343  func (this AudioParam) HasFuncLinearRampToValueAtTime() bool {
   344  	return js.True == bindings.HasFuncAudioParamLinearRampToValueAtTime(
   345  		this.ref,
   346  	)
   347  }
   348  
   349  // FuncLinearRampToValueAtTime returns the method "AudioParam.linearRampToValueAtTime".
   350  func (this AudioParam) FuncLinearRampToValueAtTime() (fn js.Func[func(value float32, endTime float64) AudioParam]) {
   351  	bindings.FuncAudioParamLinearRampToValueAtTime(
   352  		this.ref, js.Pointer(&fn),
   353  	)
   354  	return
   355  }
   356  
   357  // LinearRampToValueAtTime calls the method "AudioParam.linearRampToValueAtTime".
   358  func (this AudioParam) LinearRampToValueAtTime(value float32, endTime float64) (ret AudioParam) {
   359  	bindings.CallAudioParamLinearRampToValueAtTime(
   360  		this.ref, js.Pointer(&ret),
   361  		float32(value),
   362  		float64(endTime),
   363  	)
   364  
   365  	return
   366  }
   367  
   368  // TryLinearRampToValueAtTime calls the method "AudioParam.linearRampToValueAtTime"
   369  // in a try/catch block and returns (_, err, ok = false) when it went through
   370  // the catch clause.
   371  func (this AudioParam) TryLinearRampToValueAtTime(value float32, endTime float64) (ret AudioParam, exception js.Any, ok bool) {
   372  	ok = js.True == bindings.TryAudioParamLinearRampToValueAtTime(
   373  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   374  		float32(value),
   375  		float64(endTime),
   376  	)
   377  
   378  	return
   379  }
   380  
   381  // HasFuncExponentialRampToValueAtTime returns true if the method "AudioParam.exponentialRampToValueAtTime" exists.
   382  func (this AudioParam) HasFuncExponentialRampToValueAtTime() bool {
   383  	return js.True == bindings.HasFuncAudioParamExponentialRampToValueAtTime(
   384  		this.ref,
   385  	)
   386  }
   387  
   388  // FuncExponentialRampToValueAtTime returns the method "AudioParam.exponentialRampToValueAtTime".
   389  func (this AudioParam) FuncExponentialRampToValueAtTime() (fn js.Func[func(value float32, endTime float64) AudioParam]) {
   390  	bindings.FuncAudioParamExponentialRampToValueAtTime(
   391  		this.ref, js.Pointer(&fn),
   392  	)
   393  	return
   394  }
   395  
   396  // ExponentialRampToValueAtTime calls the method "AudioParam.exponentialRampToValueAtTime".
   397  func (this AudioParam) ExponentialRampToValueAtTime(value float32, endTime float64) (ret AudioParam) {
   398  	bindings.CallAudioParamExponentialRampToValueAtTime(
   399  		this.ref, js.Pointer(&ret),
   400  		float32(value),
   401  		float64(endTime),
   402  	)
   403  
   404  	return
   405  }
   406  
   407  // TryExponentialRampToValueAtTime calls the method "AudioParam.exponentialRampToValueAtTime"
   408  // in a try/catch block and returns (_, err, ok = false) when it went through
   409  // the catch clause.
   410  func (this AudioParam) TryExponentialRampToValueAtTime(value float32, endTime float64) (ret AudioParam, exception js.Any, ok bool) {
   411  	ok = js.True == bindings.TryAudioParamExponentialRampToValueAtTime(
   412  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   413  		float32(value),
   414  		float64(endTime),
   415  	)
   416  
   417  	return
   418  }
   419  
   420  // HasFuncSetTargetAtTime returns true if the method "AudioParam.setTargetAtTime" exists.
   421  func (this AudioParam) HasFuncSetTargetAtTime() bool {
   422  	return js.True == bindings.HasFuncAudioParamSetTargetAtTime(
   423  		this.ref,
   424  	)
   425  }
   426  
   427  // FuncSetTargetAtTime returns the method "AudioParam.setTargetAtTime".
   428  func (this AudioParam) FuncSetTargetAtTime() (fn js.Func[func(target float32, startTime float64, timeConstant float32) AudioParam]) {
   429  	bindings.FuncAudioParamSetTargetAtTime(
   430  		this.ref, js.Pointer(&fn),
   431  	)
   432  	return
   433  }
   434  
   435  // SetTargetAtTime calls the method "AudioParam.setTargetAtTime".
   436  func (this AudioParam) SetTargetAtTime(target float32, startTime float64, timeConstant float32) (ret AudioParam) {
   437  	bindings.CallAudioParamSetTargetAtTime(
   438  		this.ref, js.Pointer(&ret),
   439  		float32(target),
   440  		float64(startTime),
   441  		float32(timeConstant),
   442  	)
   443  
   444  	return
   445  }
   446  
   447  // TrySetTargetAtTime calls the method "AudioParam.setTargetAtTime"
   448  // in a try/catch block and returns (_, err, ok = false) when it went through
   449  // the catch clause.
   450  func (this AudioParam) TrySetTargetAtTime(target float32, startTime float64, timeConstant float32) (ret AudioParam, exception js.Any, ok bool) {
   451  	ok = js.True == bindings.TryAudioParamSetTargetAtTime(
   452  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   453  		float32(target),
   454  		float64(startTime),
   455  		float32(timeConstant),
   456  	)
   457  
   458  	return
   459  }
   460  
   461  // HasFuncSetValueCurveAtTime returns true if the method "AudioParam.setValueCurveAtTime" exists.
   462  func (this AudioParam) HasFuncSetValueCurveAtTime() bool {
   463  	return js.True == bindings.HasFuncAudioParamSetValueCurveAtTime(
   464  		this.ref,
   465  	)
   466  }
   467  
   468  // FuncSetValueCurveAtTime returns the method "AudioParam.setValueCurveAtTime".
   469  func (this AudioParam) FuncSetValueCurveAtTime() (fn js.Func[func(values js.Array[float32], startTime float64, duration float64) AudioParam]) {
   470  	bindings.FuncAudioParamSetValueCurveAtTime(
   471  		this.ref, js.Pointer(&fn),
   472  	)
   473  	return
   474  }
   475  
   476  // SetValueCurveAtTime calls the method "AudioParam.setValueCurveAtTime".
   477  func (this AudioParam) SetValueCurveAtTime(values js.Array[float32], startTime float64, duration float64) (ret AudioParam) {
   478  	bindings.CallAudioParamSetValueCurveAtTime(
   479  		this.ref, js.Pointer(&ret),
   480  		values.Ref(),
   481  		float64(startTime),
   482  		float64(duration),
   483  	)
   484  
   485  	return
   486  }
   487  
   488  // TrySetValueCurveAtTime calls the method "AudioParam.setValueCurveAtTime"
   489  // in a try/catch block and returns (_, err, ok = false) when it went through
   490  // the catch clause.
   491  func (this AudioParam) TrySetValueCurveAtTime(values js.Array[float32], startTime float64, duration float64) (ret AudioParam, exception js.Any, ok bool) {
   492  	ok = js.True == bindings.TryAudioParamSetValueCurveAtTime(
   493  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   494  		values.Ref(),
   495  		float64(startTime),
   496  		float64(duration),
   497  	)
   498  
   499  	return
   500  }
   501  
   502  // HasFuncCancelScheduledValues returns true if the method "AudioParam.cancelScheduledValues" exists.
   503  func (this AudioParam) HasFuncCancelScheduledValues() bool {
   504  	return js.True == bindings.HasFuncAudioParamCancelScheduledValues(
   505  		this.ref,
   506  	)
   507  }
   508  
   509  // FuncCancelScheduledValues returns the method "AudioParam.cancelScheduledValues".
   510  func (this AudioParam) FuncCancelScheduledValues() (fn js.Func[func(cancelTime float64) AudioParam]) {
   511  	bindings.FuncAudioParamCancelScheduledValues(
   512  		this.ref, js.Pointer(&fn),
   513  	)
   514  	return
   515  }
   516  
   517  // CancelScheduledValues calls the method "AudioParam.cancelScheduledValues".
   518  func (this AudioParam) CancelScheduledValues(cancelTime float64) (ret AudioParam) {
   519  	bindings.CallAudioParamCancelScheduledValues(
   520  		this.ref, js.Pointer(&ret),
   521  		float64(cancelTime),
   522  	)
   523  
   524  	return
   525  }
   526  
   527  // TryCancelScheduledValues calls the method "AudioParam.cancelScheduledValues"
   528  // in a try/catch block and returns (_, err, ok = false) when it went through
   529  // the catch clause.
   530  func (this AudioParam) TryCancelScheduledValues(cancelTime float64) (ret AudioParam, exception js.Any, ok bool) {
   531  	ok = js.True == bindings.TryAudioParamCancelScheduledValues(
   532  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   533  		float64(cancelTime),
   534  	)
   535  
   536  	return
   537  }
   538  
   539  // HasFuncCancelAndHoldAtTime returns true if the method "AudioParam.cancelAndHoldAtTime" exists.
   540  func (this AudioParam) HasFuncCancelAndHoldAtTime() bool {
   541  	return js.True == bindings.HasFuncAudioParamCancelAndHoldAtTime(
   542  		this.ref,
   543  	)
   544  }
   545  
   546  // FuncCancelAndHoldAtTime returns the method "AudioParam.cancelAndHoldAtTime".
   547  func (this AudioParam) FuncCancelAndHoldAtTime() (fn js.Func[func(cancelTime float64) AudioParam]) {
   548  	bindings.FuncAudioParamCancelAndHoldAtTime(
   549  		this.ref, js.Pointer(&fn),
   550  	)
   551  	return
   552  }
   553  
   554  // CancelAndHoldAtTime calls the method "AudioParam.cancelAndHoldAtTime".
   555  func (this AudioParam) CancelAndHoldAtTime(cancelTime float64) (ret AudioParam) {
   556  	bindings.CallAudioParamCancelAndHoldAtTime(
   557  		this.ref, js.Pointer(&ret),
   558  		float64(cancelTime),
   559  	)
   560  
   561  	return
   562  }
   563  
   564  // TryCancelAndHoldAtTime calls the method "AudioParam.cancelAndHoldAtTime"
   565  // in a try/catch block and returns (_, err, ok = false) when it went through
   566  // the catch clause.
   567  func (this AudioParam) TryCancelAndHoldAtTime(cancelTime float64) (ret AudioParam, exception js.Any, ok bool) {
   568  	ok = js.True == bindings.TryAudioParamCancelAndHoldAtTime(
   569  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   570  		float64(cancelTime),
   571  	)
   572  
   573  	return
   574  }
   575  
   576  func NewBiquadFilterNode(context BaseAudioContext, options BiquadFilterOptions) (ret BiquadFilterNode) {
   577  	ret.ref = bindings.NewBiquadFilterNodeByBiquadFilterNode(
   578  		context.Ref(),
   579  		js.Pointer(&options))
   580  	return
   581  }
   582  
   583  func NewBiquadFilterNodeByBiquadFilterNode1(context BaseAudioContext) (ret BiquadFilterNode) {
   584  	ret.ref = bindings.NewBiquadFilterNodeByBiquadFilterNode1(
   585  		context.Ref())
   586  	return
   587  }
   588  
   589  type BiquadFilterNode struct {
   590  	AudioNode
   591  }
   592  
   593  func (this BiquadFilterNode) Once() BiquadFilterNode {
   594  	this.ref.Once()
   595  	return this
   596  }
   597  
   598  func (this BiquadFilterNode) Ref() js.Ref {
   599  	return this.AudioNode.Ref()
   600  }
   601  
   602  func (this BiquadFilterNode) FromRef(ref js.Ref) BiquadFilterNode {
   603  	this.AudioNode = this.AudioNode.FromRef(ref)
   604  	return this
   605  }
   606  
   607  func (this BiquadFilterNode) Free() {
   608  	this.ref.Free()
   609  }
   610  
   611  // Type returns the value of property "BiquadFilterNode.type".
   612  //
   613  // It returns ok=false if there is no such property.
   614  func (this BiquadFilterNode) Type() (ret BiquadFilterType, ok bool) {
   615  	ok = js.True == bindings.GetBiquadFilterNodeType(
   616  		this.ref, js.Pointer(&ret),
   617  	)
   618  	return
   619  }
   620  
   621  // SetType sets the value of property "BiquadFilterNode.type" to val.
   622  //
   623  // It returns false if the property cannot be set.
   624  func (this BiquadFilterNode) SetType(val BiquadFilterType) bool {
   625  	return js.True == bindings.SetBiquadFilterNodeType(
   626  		this.ref,
   627  		uint32(val),
   628  	)
   629  }
   630  
   631  // Frequency returns the value of property "BiquadFilterNode.frequency".
   632  //
   633  // It returns ok=false if there is no such property.
   634  func (this BiquadFilterNode) Frequency() (ret AudioParam, ok bool) {
   635  	ok = js.True == bindings.GetBiquadFilterNodeFrequency(
   636  		this.ref, js.Pointer(&ret),
   637  	)
   638  	return
   639  }
   640  
   641  // Detune returns the value of property "BiquadFilterNode.detune".
   642  //
   643  // It returns ok=false if there is no such property.
   644  func (this BiquadFilterNode) Detune() (ret AudioParam, ok bool) {
   645  	ok = js.True == bindings.GetBiquadFilterNodeDetune(
   646  		this.ref, js.Pointer(&ret),
   647  	)
   648  	return
   649  }
   650  
   651  // Q returns the value of property "BiquadFilterNode.Q".
   652  //
   653  // It returns ok=false if there is no such property.
   654  func (this BiquadFilterNode) Q() (ret AudioParam, ok bool) {
   655  	ok = js.True == bindings.GetBiquadFilterNodeQ(
   656  		this.ref, js.Pointer(&ret),
   657  	)
   658  	return
   659  }
   660  
   661  // Gain returns the value of property "BiquadFilterNode.gain".
   662  //
   663  // It returns ok=false if there is no such property.
   664  func (this BiquadFilterNode) Gain() (ret AudioParam, ok bool) {
   665  	ok = js.True == bindings.GetBiquadFilterNodeGain(
   666  		this.ref, js.Pointer(&ret),
   667  	)
   668  	return
   669  }
   670  
   671  // HasFuncGetFrequencyResponse returns true if the method "BiquadFilterNode.getFrequencyResponse" exists.
   672  func (this BiquadFilterNode) HasFuncGetFrequencyResponse() bool {
   673  	return js.True == bindings.HasFuncBiquadFilterNodeGetFrequencyResponse(
   674  		this.ref,
   675  	)
   676  }
   677  
   678  // FuncGetFrequencyResponse returns the method "BiquadFilterNode.getFrequencyResponse".
   679  func (this BiquadFilterNode) FuncGetFrequencyResponse() (fn js.Func[func(frequencyHz js.TypedArray[float32], magResponse js.TypedArray[float32], phaseResponse js.TypedArray[float32])]) {
   680  	bindings.FuncBiquadFilterNodeGetFrequencyResponse(
   681  		this.ref, js.Pointer(&fn),
   682  	)
   683  	return
   684  }
   685  
   686  // GetFrequencyResponse calls the method "BiquadFilterNode.getFrequencyResponse".
   687  func (this BiquadFilterNode) GetFrequencyResponse(frequencyHz js.TypedArray[float32], magResponse js.TypedArray[float32], phaseResponse js.TypedArray[float32]) (ret js.Void) {
   688  	bindings.CallBiquadFilterNodeGetFrequencyResponse(
   689  		this.ref, js.Pointer(&ret),
   690  		frequencyHz.Ref(),
   691  		magResponse.Ref(),
   692  		phaseResponse.Ref(),
   693  	)
   694  
   695  	return
   696  }
   697  
   698  // TryGetFrequencyResponse calls the method "BiquadFilterNode.getFrequencyResponse"
   699  // in a try/catch block and returns (_, err, ok = false) when it went through
   700  // the catch clause.
   701  func (this BiquadFilterNode) TryGetFrequencyResponse(frequencyHz js.TypedArray[float32], magResponse js.TypedArray[float32], phaseResponse js.TypedArray[float32]) (ret js.Void, exception js.Any, ok bool) {
   702  	ok = js.True == bindings.TryBiquadFilterNodeGetFrequencyResponse(
   703  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   704  		frequencyHz.Ref(),
   705  		magResponse.Ref(),
   706  		phaseResponse.Ref(),
   707  	)
   708  
   709  	return
   710  }
   711  
   712  type AudioBufferOptions struct {
   713  	// NumberOfChannels is "AudioBufferOptions.numberOfChannels"
   714  	//
   715  	// Optional, defaults to 1.
   716  	//
   717  	// NOTE: FFI_USE_NumberOfChannels MUST be set to true to make this field effective.
   718  	NumberOfChannels uint32
   719  	// Length is "AudioBufferOptions.length"
   720  	//
   721  	// Required
   722  	Length uint32
   723  	// SampleRate is "AudioBufferOptions.sampleRate"
   724  	//
   725  	// Required
   726  	SampleRate float32
   727  
   728  	FFI_USE_NumberOfChannels bool // for NumberOfChannels.
   729  
   730  	FFI_USE bool
   731  }
   732  
   733  // FromRef calls UpdateFrom and returns a AudioBufferOptions with all fields set.
   734  func (p AudioBufferOptions) FromRef(ref js.Ref) AudioBufferOptions {
   735  	p.UpdateFrom(ref)
   736  	return p
   737  }
   738  
   739  // New creates a new AudioBufferOptions in the application heap.
   740  func (p AudioBufferOptions) New() js.Ref {
   741  	return bindings.AudioBufferOptionsJSLoad(
   742  		js.Pointer(&p), js.True, 0,
   743  	)
   744  }
   745  
   746  // UpdateFrom copies value of all fields of the heap object to p.
   747  func (p *AudioBufferOptions) UpdateFrom(ref js.Ref) {
   748  	bindings.AudioBufferOptionsJSStore(
   749  		js.Pointer(p), ref,
   750  	)
   751  }
   752  
   753  // Update writes all fields of the p to the heap object referenced by ref.
   754  func (p *AudioBufferOptions) Update(ref js.Ref) {
   755  	bindings.AudioBufferOptionsJSLoad(
   756  		js.Pointer(p), js.False, ref,
   757  	)
   758  }
   759  
   760  // FreeMembers frees fields with heap reference, if recursive is true
   761  // free all heap references reachable from p.
   762  func (p *AudioBufferOptions) FreeMembers(recursive bool) {
   763  }
   764  
   765  func NewAudioBuffer(options AudioBufferOptions) (ret AudioBuffer) {
   766  	ret.ref = bindings.NewAudioBufferByAudioBuffer(
   767  		js.Pointer(&options))
   768  	return
   769  }
   770  
   771  type AudioBuffer struct {
   772  	ref js.Ref
   773  }
   774  
   775  func (this AudioBuffer) Once() AudioBuffer {
   776  	this.ref.Once()
   777  	return this
   778  }
   779  
   780  func (this AudioBuffer) Ref() js.Ref {
   781  	return this.ref
   782  }
   783  
   784  func (this AudioBuffer) FromRef(ref js.Ref) AudioBuffer {
   785  	this.ref = ref
   786  	return this
   787  }
   788  
   789  func (this AudioBuffer) Free() {
   790  	this.ref.Free()
   791  }
   792  
   793  // SampleRate returns the value of property "AudioBuffer.sampleRate".
   794  //
   795  // It returns ok=false if there is no such property.
   796  func (this AudioBuffer) SampleRate() (ret float32, ok bool) {
   797  	ok = js.True == bindings.GetAudioBufferSampleRate(
   798  		this.ref, js.Pointer(&ret),
   799  	)
   800  	return
   801  }
   802  
   803  // Length returns the value of property "AudioBuffer.length".
   804  //
   805  // It returns ok=false if there is no such property.
   806  func (this AudioBuffer) Length() (ret uint32, ok bool) {
   807  	ok = js.True == bindings.GetAudioBufferLength(
   808  		this.ref, js.Pointer(&ret),
   809  	)
   810  	return
   811  }
   812  
   813  // Duration returns the value of property "AudioBuffer.duration".
   814  //
   815  // It returns ok=false if there is no such property.
   816  func (this AudioBuffer) Duration() (ret float64, ok bool) {
   817  	ok = js.True == bindings.GetAudioBufferDuration(
   818  		this.ref, js.Pointer(&ret),
   819  	)
   820  	return
   821  }
   822  
   823  // NumberOfChannels returns the value of property "AudioBuffer.numberOfChannels".
   824  //
   825  // It returns ok=false if there is no such property.
   826  func (this AudioBuffer) NumberOfChannels() (ret uint32, ok bool) {
   827  	ok = js.True == bindings.GetAudioBufferNumberOfChannels(
   828  		this.ref, js.Pointer(&ret),
   829  	)
   830  	return
   831  }
   832  
   833  // HasFuncGetChannelData returns true if the method "AudioBuffer.getChannelData" exists.
   834  func (this AudioBuffer) HasFuncGetChannelData() bool {
   835  	return js.True == bindings.HasFuncAudioBufferGetChannelData(
   836  		this.ref,
   837  	)
   838  }
   839  
   840  // FuncGetChannelData returns the method "AudioBuffer.getChannelData".
   841  func (this AudioBuffer) FuncGetChannelData() (fn js.Func[func(channel uint32) js.TypedArray[float32]]) {
   842  	bindings.FuncAudioBufferGetChannelData(
   843  		this.ref, js.Pointer(&fn),
   844  	)
   845  	return
   846  }
   847  
   848  // GetChannelData calls the method "AudioBuffer.getChannelData".
   849  func (this AudioBuffer) GetChannelData(channel uint32) (ret js.TypedArray[float32]) {
   850  	bindings.CallAudioBufferGetChannelData(
   851  		this.ref, js.Pointer(&ret),
   852  		uint32(channel),
   853  	)
   854  
   855  	return
   856  }
   857  
   858  // TryGetChannelData calls the method "AudioBuffer.getChannelData"
   859  // in a try/catch block and returns (_, err, ok = false) when it went through
   860  // the catch clause.
   861  func (this AudioBuffer) TryGetChannelData(channel uint32) (ret js.TypedArray[float32], exception js.Any, ok bool) {
   862  	ok = js.True == bindings.TryAudioBufferGetChannelData(
   863  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   864  		uint32(channel),
   865  	)
   866  
   867  	return
   868  }
   869  
   870  // HasFuncCopyFromChannel returns true if the method "AudioBuffer.copyFromChannel" exists.
   871  func (this AudioBuffer) HasFuncCopyFromChannel() bool {
   872  	return js.True == bindings.HasFuncAudioBufferCopyFromChannel(
   873  		this.ref,
   874  	)
   875  }
   876  
   877  // FuncCopyFromChannel returns the method "AudioBuffer.copyFromChannel".
   878  func (this AudioBuffer) FuncCopyFromChannel() (fn js.Func[func(destination js.TypedArray[float32], channelNumber uint32, bufferOffset uint32)]) {
   879  	bindings.FuncAudioBufferCopyFromChannel(
   880  		this.ref, js.Pointer(&fn),
   881  	)
   882  	return
   883  }
   884  
   885  // CopyFromChannel calls the method "AudioBuffer.copyFromChannel".
   886  func (this AudioBuffer) CopyFromChannel(destination js.TypedArray[float32], channelNumber uint32, bufferOffset uint32) (ret js.Void) {
   887  	bindings.CallAudioBufferCopyFromChannel(
   888  		this.ref, js.Pointer(&ret),
   889  		destination.Ref(),
   890  		uint32(channelNumber),
   891  		uint32(bufferOffset),
   892  	)
   893  
   894  	return
   895  }
   896  
   897  // TryCopyFromChannel calls the method "AudioBuffer.copyFromChannel"
   898  // in a try/catch block and returns (_, err, ok = false) when it went through
   899  // the catch clause.
   900  func (this AudioBuffer) TryCopyFromChannel(destination js.TypedArray[float32], channelNumber uint32, bufferOffset uint32) (ret js.Void, exception js.Any, ok bool) {
   901  	ok = js.True == bindings.TryAudioBufferCopyFromChannel(
   902  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   903  		destination.Ref(),
   904  		uint32(channelNumber),
   905  		uint32(bufferOffset),
   906  	)
   907  
   908  	return
   909  }
   910  
   911  // HasFuncCopyFromChannel1 returns true if the method "AudioBuffer.copyFromChannel" exists.
   912  func (this AudioBuffer) HasFuncCopyFromChannel1() bool {
   913  	return js.True == bindings.HasFuncAudioBufferCopyFromChannel1(
   914  		this.ref,
   915  	)
   916  }
   917  
   918  // FuncCopyFromChannel1 returns the method "AudioBuffer.copyFromChannel".
   919  func (this AudioBuffer) FuncCopyFromChannel1() (fn js.Func[func(destination js.TypedArray[float32], channelNumber uint32)]) {
   920  	bindings.FuncAudioBufferCopyFromChannel1(
   921  		this.ref, js.Pointer(&fn),
   922  	)
   923  	return
   924  }
   925  
   926  // CopyFromChannel1 calls the method "AudioBuffer.copyFromChannel".
   927  func (this AudioBuffer) CopyFromChannel1(destination js.TypedArray[float32], channelNumber uint32) (ret js.Void) {
   928  	bindings.CallAudioBufferCopyFromChannel1(
   929  		this.ref, js.Pointer(&ret),
   930  		destination.Ref(),
   931  		uint32(channelNumber),
   932  	)
   933  
   934  	return
   935  }
   936  
   937  // TryCopyFromChannel1 calls the method "AudioBuffer.copyFromChannel"
   938  // in a try/catch block and returns (_, err, ok = false) when it went through
   939  // the catch clause.
   940  func (this AudioBuffer) TryCopyFromChannel1(destination js.TypedArray[float32], channelNumber uint32) (ret js.Void, exception js.Any, ok bool) {
   941  	ok = js.True == bindings.TryAudioBufferCopyFromChannel1(
   942  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   943  		destination.Ref(),
   944  		uint32(channelNumber),
   945  	)
   946  
   947  	return
   948  }
   949  
   950  // HasFuncCopyToChannel returns true if the method "AudioBuffer.copyToChannel" exists.
   951  func (this AudioBuffer) HasFuncCopyToChannel() bool {
   952  	return js.True == bindings.HasFuncAudioBufferCopyToChannel(
   953  		this.ref,
   954  	)
   955  }
   956  
   957  // FuncCopyToChannel returns the method "AudioBuffer.copyToChannel".
   958  func (this AudioBuffer) FuncCopyToChannel() (fn js.Func[func(source js.TypedArray[float32], channelNumber uint32, bufferOffset uint32)]) {
   959  	bindings.FuncAudioBufferCopyToChannel(
   960  		this.ref, js.Pointer(&fn),
   961  	)
   962  	return
   963  }
   964  
   965  // CopyToChannel calls the method "AudioBuffer.copyToChannel".
   966  func (this AudioBuffer) CopyToChannel(source js.TypedArray[float32], channelNumber uint32, bufferOffset uint32) (ret js.Void) {
   967  	bindings.CallAudioBufferCopyToChannel(
   968  		this.ref, js.Pointer(&ret),
   969  		source.Ref(),
   970  		uint32(channelNumber),
   971  		uint32(bufferOffset),
   972  	)
   973  
   974  	return
   975  }
   976  
   977  // TryCopyToChannel calls the method "AudioBuffer.copyToChannel"
   978  // in a try/catch block and returns (_, err, ok = false) when it went through
   979  // the catch clause.
   980  func (this AudioBuffer) TryCopyToChannel(source js.TypedArray[float32], channelNumber uint32, bufferOffset uint32) (ret js.Void, exception js.Any, ok bool) {
   981  	ok = js.True == bindings.TryAudioBufferCopyToChannel(
   982  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   983  		source.Ref(),
   984  		uint32(channelNumber),
   985  		uint32(bufferOffset),
   986  	)
   987  
   988  	return
   989  }
   990  
   991  // HasFuncCopyToChannel1 returns true if the method "AudioBuffer.copyToChannel" exists.
   992  func (this AudioBuffer) HasFuncCopyToChannel1() bool {
   993  	return js.True == bindings.HasFuncAudioBufferCopyToChannel1(
   994  		this.ref,
   995  	)
   996  }
   997  
   998  // FuncCopyToChannel1 returns the method "AudioBuffer.copyToChannel".
   999  func (this AudioBuffer) FuncCopyToChannel1() (fn js.Func[func(source js.TypedArray[float32], channelNumber uint32)]) {
  1000  	bindings.FuncAudioBufferCopyToChannel1(
  1001  		this.ref, js.Pointer(&fn),
  1002  	)
  1003  	return
  1004  }
  1005  
  1006  // CopyToChannel1 calls the method "AudioBuffer.copyToChannel".
  1007  func (this AudioBuffer) CopyToChannel1(source js.TypedArray[float32], channelNumber uint32) (ret js.Void) {
  1008  	bindings.CallAudioBufferCopyToChannel1(
  1009  		this.ref, js.Pointer(&ret),
  1010  		source.Ref(),
  1011  		uint32(channelNumber),
  1012  	)
  1013  
  1014  	return
  1015  }
  1016  
  1017  // TryCopyToChannel1 calls the method "AudioBuffer.copyToChannel"
  1018  // in a try/catch block and returns (_, err, ok = false) when it went through
  1019  // the catch clause.
  1020  func (this AudioBuffer) TryCopyToChannel1(source js.TypedArray[float32], channelNumber uint32) (ret js.Void, exception js.Any, ok bool) {
  1021  	ok = js.True == bindings.TryAudioBufferCopyToChannel1(
  1022  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1023  		source.Ref(),
  1024  		uint32(channelNumber),
  1025  	)
  1026  
  1027  	return
  1028  }
  1029  
  1030  type AudioBufferSourceOptions struct {
  1031  	// Buffer is "AudioBufferSourceOptions.buffer"
  1032  	//
  1033  	// Optional
  1034  	Buffer AudioBuffer
  1035  	// Detune is "AudioBufferSourceOptions.detune"
  1036  	//
  1037  	// Optional, defaults to 0.
  1038  	//
  1039  	// NOTE: FFI_USE_Detune MUST be set to true to make this field effective.
  1040  	Detune float32
  1041  	// Loop is "AudioBufferSourceOptions.loop"
  1042  	//
  1043  	// Optional, defaults to false.
  1044  	//
  1045  	// NOTE: FFI_USE_Loop MUST be set to true to make this field effective.
  1046  	Loop bool
  1047  	// LoopEnd is "AudioBufferSourceOptions.loopEnd"
  1048  	//
  1049  	// Optional, defaults to 0.
  1050  	//
  1051  	// NOTE: FFI_USE_LoopEnd MUST be set to true to make this field effective.
  1052  	LoopEnd float64
  1053  	// LoopStart is "AudioBufferSourceOptions.loopStart"
  1054  	//
  1055  	// Optional, defaults to 0.
  1056  	//
  1057  	// NOTE: FFI_USE_LoopStart MUST be set to true to make this field effective.
  1058  	LoopStart float64
  1059  	// PlaybackRate is "AudioBufferSourceOptions.playbackRate"
  1060  	//
  1061  	// Optional, defaults to 1.
  1062  	//
  1063  	// NOTE: FFI_USE_PlaybackRate MUST be set to true to make this field effective.
  1064  	PlaybackRate float32
  1065  
  1066  	FFI_USE_Detune       bool // for Detune.
  1067  	FFI_USE_Loop         bool // for Loop.
  1068  	FFI_USE_LoopEnd      bool // for LoopEnd.
  1069  	FFI_USE_LoopStart    bool // for LoopStart.
  1070  	FFI_USE_PlaybackRate bool // for PlaybackRate.
  1071  
  1072  	FFI_USE bool
  1073  }
  1074  
  1075  // FromRef calls UpdateFrom and returns a AudioBufferSourceOptions with all fields set.
  1076  func (p AudioBufferSourceOptions) FromRef(ref js.Ref) AudioBufferSourceOptions {
  1077  	p.UpdateFrom(ref)
  1078  	return p
  1079  }
  1080  
  1081  // New creates a new AudioBufferSourceOptions in the application heap.
  1082  func (p AudioBufferSourceOptions) New() js.Ref {
  1083  	return bindings.AudioBufferSourceOptionsJSLoad(
  1084  		js.Pointer(&p), js.True, 0,
  1085  	)
  1086  }
  1087  
  1088  // UpdateFrom copies value of all fields of the heap object to p.
  1089  func (p *AudioBufferSourceOptions) UpdateFrom(ref js.Ref) {
  1090  	bindings.AudioBufferSourceOptionsJSStore(
  1091  		js.Pointer(p), ref,
  1092  	)
  1093  }
  1094  
  1095  // Update writes all fields of the p to the heap object referenced by ref.
  1096  func (p *AudioBufferSourceOptions) Update(ref js.Ref) {
  1097  	bindings.AudioBufferSourceOptionsJSLoad(
  1098  		js.Pointer(p), js.False, ref,
  1099  	)
  1100  }
  1101  
  1102  // FreeMembers frees fields with heap reference, if recursive is true
  1103  // free all heap references reachable from p.
  1104  func (p *AudioBufferSourceOptions) FreeMembers(recursive bool) {
  1105  	js.Free(
  1106  		p.Buffer.Ref(),
  1107  	)
  1108  	p.Buffer = p.Buffer.FromRef(js.Undefined)
  1109  }
  1110  
  1111  func NewAudioBufferSourceNode(context BaseAudioContext, options AudioBufferSourceOptions) (ret AudioBufferSourceNode) {
  1112  	ret.ref = bindings.NewAudioBufferSourceNodeByAudioBufferSourceNode(
  1113  		context.Ref(),
  1114  		js.Pointer(&options))
  1115  	return
  1116  }
  1117  
  1118  func NewAudioBufferSourceNodeByAudioBufferSourceNode1(context BaseAudioContext) (ret AudioBufferSourceNode) {
  1119  	ret.ref = bindings.NewAudioBufferSourceNodeByAudioBufferSourceNode1(
  1120  		context.Ref())
  1121  	return
  1122  }
  1123  
  1124  type AudioBufferSourceNode struct {
  1125  	AudioScheduledSourceNode
  1126  }
  1127  
  1128  func (this AudioBufferSourceNode) Once() AudioBufferSourceNode {
  1129  	this.ref.Once()
  1130  	return this
  1131  }
  1132  
  1133  func (this AudioBufferSourceNode) Ref() js.Ref {
  1134  	return this.AudioScheduledSourceNode.Ref()
  1135  }
  1136  
  1137  func (this AudioBufferSourceNode) FromRef(ref js.Ref) AudioBufferSourceNode {
  1138  	this.AudioScheduledSourceNode = this.AudioScheduledSourceNode.FromRef(ref)
  1139  	return this
  1140  }
  1141  
  1142  func (this AudioBufferSourceNode) Free() {
  1143  	this.ref.Free()
  1144  }
  1145  
  1146  // Buffer returns the value of property "AudioBufferSourceNode.buffer".
  1147  //
  1148  // It returns ok=false if there is no such property.
  1149  func (this AudioBufferSourceNode) Buffer() (ret AudioBuffer, ok bool) {
  1150  	ok = js.True == bindings.GetAudioBufferSourceNodeBuffer(
  1151  		this.ref, js.Pointer(&ret),
  1152  	)
  1153  	return
  1154  }
  1155  
  1156  // SetBuffer sets the value of property "AudioBufferSourceNode.buffer" to val.
  1157  //
  1158  // It returns false if the property cannot be set.
  1159  func (this AudioBufferSourceNode) SetBuffer(val AudioBuffer) bool {
  1160  	return js.True == bindings.SetAudioBufferSourceNodeBuffer(
  1161  		this.ref,
  1162  		val.Ref(),
  1163  	)
  1164  }
  1165  
  1166  // PlaybackRate returns the value of property "AudioBufferSourceNode.playbackRate".
  1167  //
  1168  // It returns ok=false if there is no such property.
  1169  func (this AudioBufferSourceNode) PlaybackRate() (ret AudioParam, ok bool) {
  1170  	ok = js.True == bindings.GetAudioBufferSourceNodePlaybackRate(
  1171  		this.ref, js.Pointer(&ret),
  1172  	)
  1173  	return
  1174  }
  1175  
  1176  // Detune returns the value of property "AudioBufferSourceNode.detune".
  1177  //
  1178  // It returns ok=false if there is no such property.
  1179  func (this AudioBufferSourceNode) Detune() (ret AudioParam, ok bool) {
  1180  	ok = js.True == bindings.GetAudioBufferSourceNodeDetune(
  1181  		this.ref, js.Pointer(&ret),
  1182  	)
  1183  	return
  1184  }
  1185  
  1186  // Loop returns the value of property "AudioBufferSourceNode.loop".
  1187  //
  1188  // It returns ok=false if there is no such property.
  1189  func (this AudioBufferSourceNode) Loop() (ret bool, ok bool) {
  1190  	ok = js.True == bindings.GetAudioBufferSourceNodeLoop(
  1191  		this.ref, js.Pointer(&ret),
  1192  	)
  1193  	return
  1194  }
  1195  
  1196  // SetLoop sets the value of property "AudioBufferSourceNode.loop" to val.
  1197  //
  1198  // It returns false if the property cannot be set.
  1199  func (this AudioBufferSourceNode) SetLoop(val bool) bool {
  1200  	return js.True == bindings.SetAudioBufferSourceNodeLoop(
  1201  		this.ref,
  1202  		js.Bool(bool(val)),
  1203  	)
  1204  }
  1205  
  1206  // LoopStart returns the value of property "AudioBufferSourceNode.loopStart".
  1207  //
  1208  // It returns ok=false if there is no such property.
  1209  func (this AudioBufferSourceNode) LoopStart() (ret float64, ok bool) {
  1210  	ok = js.True == bindings.GetAudioBufferSourceNodeLoopStart(
  1211  		this.ref, js.Pointer(&ret),
  1212  	)
  1213  	return
  1214  }
  1215  
  1216  // SetLoopStart sets the value of property "AudioBufferSourceNode.loopStart" to val.
  1217  //
  1218  // It returns false if the property cannot be set.
  1219  func (this AudioBufferSourceNode) SetLoopStart(val float64) bool {
  1220  	return js.True == bindings.SetAudioBufferSourceNodeLoopStart(
  1221  		this.ref,
  1222  		float64(val),
  1223  	)
  1224  }
  1225  
  1226  // LoopEnd returns the value of property "AudioBufferSourceNode.loopEnd".
  1227  //
  1228  // It returns ok=false if there is no such property.
  1229  func (this AudioBufferSourceNode) LoopEnd() (ret float64, ok bool) {
  1230  	ok = js.True == bindings.GetAudioBufferSourceNodeLoopEnd(
  1231  		this.ref, js.Pointer(&ret),
  1232  	)
  1233  	return
  1234  }
  1235  
  1236  // SetLoopEnd sets the value of property "AudioBufferSourceNode.loopEnd" to val.
  1237  //
  1238  // It returns false if the property cannot be set.
  1239  func (this AudioBufferSourceNode) SetLoopEnd(val float64) bool {
  1240  	return js.True == bindings.SetAudioBufferSourceNodeLoopEnd(
  1241  		this.ref,
  1242  		float64(val),
  1243  	)
  1244  }
  1245  
  1246  // HasFuncStart returns true if the method "AudioBufferSourceNode.start" exists.
  1247  func (this AudioBufferSourceNode) HasFuncStart() bool {
  1248  	return js.True == bindings.HasFuncAudioBufferSourceNodeStart(
  1249  		this.ref,
  1250  	)
  1251  }
  1252  
  1253  // FuncStart returns the method "AudioBufferSourceNode.start".
  1254  func (this AudioBufferSourceNode) FuncStart() (fn js.Func[func(when float64, offset float64, duration float64)]) {
  1255  	bindings.FuncAudioBufferSourceNodeStart(
  1256  		this.ref, js.Pointer(&fn),
  1257  	)
  1258  	return
  1259  }
  1260  
  1261  // Start calls the method "AudioBufferSourceNode.start".
  1262  func (this AudioBufferSourceNode) Start(when float64, offset float64, duration float64) (ret js.Void) {
  1263  	bindings.CallAudioBufferSourceNodeStart(
  1264  		this.ref, js.Pointer(&ret),
  1265  		float64(when),
  1266  		float64(offset),
  1267  		float64(duration),
  1268  	)
  1269  
  1270  	return
  1271  }
  1272  
  1273  // TryStart calls the method "AudioBufferSourceNode.start"
  1274  // in a try/catch block and returns (_, err, ok = false) when it went through
  1275  // the catch clause.
  1276  func (this AudioBufferSourceNode) TryStart(when float64, offset float64, duration float64) (ret js.Void, exception js.Any, ok bool) {
  1277  	ok = js.True == bindings.TryAudioBufferSourceNodeStart(
  1278  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1279  		float64(when),
  1280  		float64(offset),
  1281  		float64(duration),
  1282  	)
  1283  
  1284  	return
  1285  }
  1286  
  1287  // HasFuncStart1 returns true if the method "AudioBufferSourceNode.start" exists.
  1288  func (this AudioBufferSourceNode) HasFuncStart1() bool {
  1289  	return js.True == bindings.HasFuncAudioBufferSourceNodeStart1(
  1290  		this.ref,
  1291  	)
  1292  }
  1293  
  1294  // FuncStart1 returns the method "AudioBufferSourceNode.start".
  1295  func (this AudioBufferSourceNode) FuncStart1() (fn js.Func[func(when float64, offset float64)]) {
  1296  	bindings.FuncAudioBufferSourceNodeStart1(
  1297  		this.ref, js.Pointer(&fn),
  1298  	)
  1299  	return
  1300  }
  1301  
  1302  // Start1 calls the method "AudioBufferSourceNode.start".
  1303  func (this AudioBufferSourceNode) Start1(when float64, offset float64) (ret js.Void) {
  1304  	bindings.CallAudioBufferSourceNodeStart1(
  1305  		this.ref, js.Pointer(&ret),
  1306  		float64(when),
  1307  		float64(offset),
  1308  	)
  1309  
  1310  	return
  1311  }
  1312  
  1313  // TryStart1 calls the method "AudioBufferSourceNode.start"
  1314  // in a try/catch block and returns (_, err, ok = false) when it went through
  1315  // the catch clause.
  1316  func (this AudioBufferSourceNode) TryStart1(when float64, offset float64) (ret js.Void, exception js.Any, ok bool) {
  1317  	ok = js.True == bindings.TryAudioBufferSourceNodeStart1(
  1318  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1319  		float64(when),
  1320  		float64(offset),
  1321  	)
  1322  
  1323  	return
  1324  }
  1325  
  1326  // HasFuncStart2 returns true if the method "AudioBufferSourceNode.start" exists.
  1327  func (this AudioBufferSourceNode) HasFuncStart2() bool {
  1328  	return js.True == bindings.HasFuncAudioBufferSourceNodeStart2(
  1329  		this.ref,
  1330  	)
  1331  }
  1332  
  1333  // FuncStart2 returns the method "AudioBufferSourceNode.start".
  1334  func (this AudioBufferSourceNode) FuncStart2() (fn js.Func[func(when float64)]) {
  1335  	bindings.FuncAudioBufferSourceNodeStart2(
  1336  		this.ref, js.Pointer(&fn),
  1337  	)
  1338  	return
  1339  }
  1340  
  1341  // Start2 calls the method "AudioBufferSourceNode.start".
  1342  func (this AudioBufferSourceNode) Start2(when float64) (ret js.Void) {
  1343  	bindings.CallAudioBufferSourceNodeStart2(
  1344  		this.ref, js.Pointer(&ret),
  1345  		float64(when),
  1346  	)
  1347  
  1348  	return
  1349  }
  1350  
  1351  // TryStart2 calls the method "AudioBufferSourceNode.start"
  1352  // in a try/catch block and returns (_, err, ok = false) when it went through
  1353  // the catch clause.
  1354  func (this AudioBufferSourceNode) TryStart2(when float64) (ret js.Void, exception js.Any, ok bool) {
  1355  	ok = js.True == bindings.TryAudioBufferSourceNodeStart2(
  1356  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1357  		float64(when),
  1358  	)
  1359  
  1360  	return
  1361  }
  1362  
  1363  // HasFuncStart3 returns true if the method "AudioBufferSourceNode.start" exists.
  1364  func (this AudioBufferSourceNode) HasFuncStart3() bool {
  1365  	return js.True == bindings.HasFuncAudioBufferSourceNodeStart3(
  1366  		this.ref,
  1367  	)
  1368  }
  1369  
  1370  // FuncStart3 returns the method "AudioBufferSourceNode.start".
  1371  func (this AudioBufferSourceNode) FuncStart3() (fn js.Func[func()]) {
  1372  	bindings.FuncAudioBufferSourceNodeStart3(
  1373  		this.ref, js.Pointer(&fn),
  1374  	)
  1375  	return
  1376  }
  1377  
  1378  // Start3 calls the method "AudioBufferSourceNode.start".
  1379  func (this AudioBufferSourceNode) Start3() (ret js.Void) {
  1380  	bindings.CallAudioBufferSourceNodeStart3(
  1381  		this.ref, js.Pointer(&ret),
  1382  	)
  1383  
  1384  	return
  1385  }
  1386  
  1387  // TryStart3 calls the method "AudioBufferSourceNode.start"
  1388  // in a try/catch block and returns (_, err, ok = false) when it went through
  1389  // the catch clause.
  1390  func (this AudioBufferSourceNode) TryStart3() (ret js.Void, exception js.Any, ok bool) {
  1391  	ok = js.True == bindings.TryAudioBufferSourceNodeStart3(
  1392  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1393  	)
  1394  
  1395  	return
  1396  }
  1397  
  1398  type ChannelMergerOptions struct {
  1399  	// NumberOfInputs is "ChannelMergerOptions.numberOfInputs"
  1400  	//
  1401  	// Optional, defaults to 6.
  1402  	//
  1403  	// NOTE: FFI_USE_NumberOfInputs MUST be set to true to make this field effective.
  1404  	NumberOfInputs uint32
  1405  	// ChannelCount is "ChannelMergerOptions.channelCount"
  1406  	//
  1407  	// Optional
  1408  	//
  1409  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
  1410  	ChannelCount uint32
  1411  	// ChannelCountMode is "ChannelMergerOptions.channelCountMode"
  1412  	//
  1413  	// Optional
  1414  	ChannelCountMode ChannelCountMode
  1415  	// ChannelInterpretation is "ChannelMergerOptions.channelInterpretation"
  1416  	//
  1417  	// Optional
  1418  	ChannelInterpretation ChannelInterpretation
  1419  
  1420  	FFI_USE_NumberOfInputs bool // for NumberOfInputs.
  1421  	FFI_USE_ChannelCount   bool // for ChannelCount.
  1422  
  1423  	FFI_USE bool
  1424  }
  1425  
  1426  // FromRef calls UpdateFrom and returns a ChannelMergerOptions with all fields set.
  1427  func (p ChannelMergerOptions) FromRef(ref js.Ref) ChannelMergerOptions {
  1428  	p.UpdateFrom(ref)
  1429  	return p
  1430  }
  1431  
  1432  // New creates a new ChannelMergerOptions in the application heap.
  1433  func (p ChannelMergerOptions) New() js.Ref {
  1434  	return bindings.ChannelMergerOptionsJSLoad(
  1435  		js.Pointer(&p), js.True, 0,
  1436  	)
  1437  }
  1438  
  1439  // UpdateFrom copies value of all fields of the heap object to p.
  1440  func (p *ChannelMergerOptions) UpdateFrom(ref js.Ref) {
  1441  	bindings.ChannelMergerOptionsJSStore(
  1442  		js.Pointer(p), ref,
  1443  	)
  1444  }
  1445  
  1446  // Update writes all fields of the p to the heap object referenced by ref.
  1447  func (p *ChannelMergerOptions) Update(ref js.Ref) {
  1448  	bindings.ChannelMergerOptionsJSLoad(
  1449  		js.Pointer(p), js.False, ref,
  1450  	)
  1451  }
  1452  
  1453  // FreeMembers frees fields with heap reference, if recursive is true
  1454  // free all heap references reachable from p.
  1455  func (p *ChannelMergerOptions) FreeMembers(recursive bool) {
  1456  }
  1457  
  1458  func NewChannelMergerNode(context BaseAudioContext, options ChannelMergerOptions) (ret ChannelMergerNode) {
  1459  	ret.ref = bindings.NewChannelMergerNodeByChannelMergerNode(
  1460  		context.Ref(),
  1461  		js.Pointer(&options))
  1462  	return
  1463  }
  1464  
  1465  func NewChannelMergerNodeByChannelMergerNode1(context BaseAudioContext) (ret ChannelMergerNode) {
  1466  	ret.ref = bindings.NewChannelMergerNodeByChannelMergerNode1(
  1467  		context.Ref())
  1468  	return
  1469  }
  1470  
  1471  type ChannelMergerNode struct {
  1472  	AudioNode
  1473  }
  1474  
  1475  func (this ChannelMergerNode) Once() ChannelMergerNode {
  1476  	this.ref.Once()
  1477  	return this
  1478  }
  1479  
  1480  func (this ChannelMergerNode) Ref() js.Ref {
  1481  	return this.AudioNode.Ref()
  1482  }
  1483  
  1484  func (this ChannelMergerNode) FromRef(ref js.Ref) ChannelMergerNode {
  1485  	this.AudioNode = this.AudioNode.FromRef(ref)
  1486  	return this
  1487  }
  1488  
  1489  func (this ChannelMergerNode) Free() {
  1490  	this.ref.Free()
  1491  }
  1492  
  1493  type ChannelSplitterOptions struct {
  1494  	// NumberOfOutputs is "ChannelSplitterOptions.numberOfOutputs"
  1495  	//
  1496  	// Optional, defaults to 6.
  1497  	//
  1498  	// NOTE: FFI_USE_NumberOfOutputs MUST be set to true to make this field effective.
  1499  	NumberOfOutputs uint32
  1500  	// ChannelCount is "ChannelSplitterOptions.channelCount"
  1501  	//
  1502  	// Optional
  1503  	//
  1504  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
  1505  	ChannelCount uint32
  1506  	// ChannelCountMode is "ChannelSplitterOptions.channelCountMode"
  1507  	//
  1508  	// Optional
  1509  	ChannelCountMode ChannelCountMode
  1510  	// ChannelInterpretation is "ChannelSplitterOptions.channelInterpretation"
  1511  	//
  1512  	// Optional
  1513  	ChannelInterpretation ChannelInterpretation
  1514  
  1515  	FFI_USE_NumberOfOutputs bool // for NumberOfOutputs.
  1516  	FFI_USE_ChannelCount    bool // for ChannelCount.
  1517  
  1518  	FFI_USE bool
  1519  }
  1520  
  1521  // FromRef calls UpdateFrom and returns a ChannelSplitterOptions with all fields set.
  1522  func (p ChannelSplitterOptions) FromRef(ref js.Ref) ChannelSplitterOptions {
  1523  	p.UpdateFrom(ref)
  1524  	return p
  1525  }
  1526  
  1527  // New creates a new ChannelSplitterOptions in the application heap.
  1528  func (p ChannelSplitterOptions) New() js.Ref {
  1529  	return bindings.ChannelSplitterOptionsJSLoad(
  1530  		js.Pointer(&p), js.True, 0,
  1531  	)
  1532  }
  1533  
  1534  // UpdateFrom copies value of all fields of the heap object to p.
  1535  func (p *ChannelSplitterOptions) UpdateFrom(ref js.Ref) {
  1536  	bindings.ChannelSplitterOptionsJSStore(
  1537  		js.Pointer(p), ref,
  1538  	)
  1539  }
  1540  
  1541  // Update writes all fields of the p to the heap object referenced by ref.
  1542  func (p *ChannelSplitterOptions) Update(ref js.Ref) {
  1543  	bindings.ChannelSplitterOptionsJSLoad(
  1544  		js.Pointer(p), js.False, ref,
  1545  	)
  1546  }
  1547  
  1548  // FreeMembers frees fields with heap reference, if recursive is true
  1549  // free all heap references reachable from p.
  1550  func (p *ChannelSplitterOptions) FreeMembers(recursive bool) {
  1551  }
  1552  
  1553  func NewChannelSplitterNode(context BaseAudioContext, options ChannelSplitterOptions) (ret ChannelSplitterNode) {
  1554  	ret.ref = bindings.NewChannelSplitterNodeByChannelSplitterNode(
  1555  		context.Ref(),
  1556  		js.Pointer(&options))
  1557  	return
  1558  }
  1559  
  1560  func NewChannelSplitterNodeByChannelSplitterNode1(context BaseAudioContext) (ret ChannelSplitterNode) {
  1561  	ret.ref = bindings.NewChannelSplitterNodeByChannelSplitterNode1(
  1562  		context.Ref())
  1563  	return
  1564  }
  1565  
  1566  type ChannelSplitterNode struct {
  1567  	AudioNode
  1568  }
  1569  
  1570  func (this ChannelSplitterNode) Once() ChannelSplitterNode {
  1571  	this.ref.Once()
  1572  	return this
  1573  }
  1574  
  1575  func (this ChannelSplitterNode) Ref() js.Ref {
  1576  	return this.AudioNode.Ref()
  1577  }
  1578  
  1579  func (this ChannelSplitterNode) FromRef(ref js.Ref) ChannelSplitterNode {
  1580  	this.AudioNode = this.AudioNode.FromRef(ref)
  1581  	return this
  1582  }
  1583  
  1584  func (this ChannelSplitterNode) Free() {
  1585  	this.ref.Free()
  1586  }
  1587  
  1588  type ConstantSourceOptions struct {
  1589  	// Offset is "ConstantSourceOptions.offset"
  1590  	//
  1591  	// Optional, defaults to 1.
  1592  	//
  1593  	// NOTE: FFI_USE_Offset MUST be set to true to make this field effective.
  1594  	Offset float32
  1595  
  1596  	FFI_USE_Offset bool // for Offset.
  1597  
  1598  	FFI_USE bool
  1599  }
  1600  
  1601  // FromRef calls UpdateFrom and returns a ConstantSourceOptions with all fields set.
  1602  func (p ConstantSourceOptions) FromRef(ref js.Ref) ConstantSourceOptions {
  1603  	p.UpdateFrom(ref)
  1604  	return p
  1605  }
  1606  
  1607  // New creates a new ConstantSourceOptions in the application heap.
  1608  func (p ConstantSourceOptions) New() js.Ref {
  1609  	return bindings.ConstantSourceOptionsJSLoad(
  1610  		js.Pointer(&p), js.True, 0,
  1611  	)
  1612  }
  1613  
  1614  // UpdateFrom copies value of all fields of the heap object to p.
  1615  func (p *ConstantSourceOptions) UpdateFrom(ref js.Ref) {
  1616  	bindings.ConstantSourceOptionsJSStore(
  1617  		js.Pointer(p), ref,
  1618  	)
  1619  }
  1620  
  1621  // Update writes all fields of the p to the heap object referenced by ref.
  1622  func (p *ConstantSourceOptions) Update(ref js.Ref) {
  1623  	bindings.ConstantSourceOptionsJSLoad(
  1624  		js.Pointer(p), js.False, ref,
  1625  	)
  1626  }
  1627  
  1628  // FreeMembers frees fields with heap reference, if recursive is true
  1629  // free all heap references reachable from p.
  1630  func (p *ConstantSourceOptions) FreeMembers(recursive bool) {
  1631  }
  1632  
  1633  func NewConstantSourceNode(context BaseAudioContext, options ConstantSourceOptions) (ret ConstantSourceNode) {
  1634  	ret.ref = bindings.NewConstantSourceNodeByConstantSourceNode(
  1635  		context.Ref(),
  1636  		js.Pointer(&options))
  1637  	return
  1638  }
  1639  
  1640  func NewConstantSourceNodeByConstantSourceNode1(context BaseAudioContext) (ret ConstantSourceNode) {
  1641  	ret.ref = bindings.NewConstantSourceNodeByConstantSourceNode1(
  1642  		context.Ref())
  1643  	return
  1644  }
  1645  
  1646  type ConstantSourceNode struct {
  1647  	AudioScheduledSourceNode
  1648  }
  1649  
  1650  func (this ConstantSourceNode) Once() ConstantSourceNode {
  1651  	this.ref.Once()
  1652  	return this
  1653  }
  1654  
  1655  func (this ConstantSourceNode) Ref() js.Ref {
  1656  	return this.AudioScheduledSourceNode.Ref()
  1657  }
  1658  
  1659  func (this ConstantSourceNode) FromRef(ref js.Ref) ConstantSourceNode {
  1660  	this.AudioScheduledSourceNode = this.AudioScheduledSourceNode.FromRef(ref)
  1661  	return this
  1662  }
  1663  
  1664  func (this ConstantSourceNode) Free() {
  1665  	this.ref.Free()
  1666  }
  1667  
  1668  // Offset returns the value of property "ConstantSourceNode.offset".
  1669  //
  1670  // It returns ok=false if there is no such property.
  1671  func (this ConstantSourceNode) Offset() (ret AudioParam, ok bool) {
  1672  	ok = js.True == bindings.GetConstantSourceNodeOffset(
  1673  		this.ref, js.Pointer(&ret),
  1674  	)
  1675  	return
  1676  }
  1677  
  1678  type ConvolverOptions struct {
  1679  	// Buffer is "ConvolverOptions.buffer"
  1680  	//
  1681  	// Optional
  1682  	Buffer AudioBuffer
  1683  	// DisableNormalization is "ConvolverOptions.disableNormalization"
  1684  	//
  1685  	// Optional, defaults to false.
  1686  	//
  1687  	// NOTE: FFI_USE_DisableNormalization MUST be set to true to make this field effective.
  1688  	DisableNormalization bool
  1689  	// ChannelCount is "ConvolverOptions.channelCount"
  1690  	//
  1691  	// Optional
  1692  	//
  1693  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
  1694  	ChannelCount uint32
  1695  	// ChannelCountMode is "ConvolverOptions.channelCountMode"
  1696  	//
  1697  	// Optional
  1698  	ChannelCountMode ChannelCountMode
  1699  	// ChannelInterpretation is "ConvolverOptions.channelInterpretation"
  1700  	//
  1701  	// Optional
  1702  	ChannelInterpretation ChannelInterpretation
  1703  
  1704  	FFI_USE_DisableNormalization bool // for DisableNormalization.
  1705  	FFI_USE_ChannelCount         bool // for ChannelCount.
  1706  
  1707  	FFI_USE bool
  1708  }
  1709  
  1710  // FromRef calls UpdateFrom and returns a ConvolverOptions with all fields set.
  1711  func (p ConvolverOptions) FromRef(ref js.Ref) ConvolverOptions {
  1712  	p.UpdateFrom(ref)
  1713  	return p
  1714  }
  1715  
  1716  // New creates a new ConvolverOptions in the application heap.
  1717  func (p ConvolverOptions) New() js.Ref {
  1718  	return bindings.ConvolverOptionsJSLoad(
  1719  		js.Pointer(&p), js.True, 0,
  1720  	)
  1721  }
  1722  
  1723  // UpdateFrom copies value of all fields of the heap object to p.
  1724  func (p *ConvolverOptions) UpdateFrom(ref js.Ref) {
  1725  	bindings.ConvolverOptionsJSStore(
  1726  		js.Pointer(p), ref,
  1727  	)
  1728  }
  1729  
  1730  // Update writes all fields of the p to the heap object referenced by ref.
  1731  func (p *ConvolverOptions) Update(ref js.Ref) {
  1732  	bindings.ConvolverOptionsJSLoad(
  1733  		js.Pointer(p), js.False, ref,
  1734  	)
  1735  }
  1736  
  1737  // FreeMembers frees fields with heap reference, if recursive is true
  1738  // free all heap references reachable from p.
  1739  func (p *ConvolverOptions) FreeMembers(recursive bool) {
  1740  	js.Free(
  1741  		p.Buffer.Ref(),
  1742  	)
  1743  	p.Buffer = p.Buffer.FromRef(js.Undefined)
  1744  }
  1745  
  1746  func NewConvolverNode(context BaseAudioContext, options ConvolverOptions) (ret ConvolverNode) {
  1747  	ret.ref = bindings.NewConvolverNodeByConvolverNode(
  1748  		context.Ref(),
  1749  		js.Pointer(&options))
  1750  	return
  1751  }
  1752  
  1753  func NewConvolverNodeByConvolverNode1(context BaseAudioContext) (ret ConvolverNode) {
  1754  	ret.ref = bindings.NewConvolverNodeByConvolverNode1(
  1755  		context.Ref())
  1756  	return
  1757  }
  1758  
  1759  type ConvolverNode struct {
  1760  	AudioNode
  1761  }
  1762  
  1763  func (this ConvolverNode) Once() ConvolverNode {
  1764  	this.ref.Once()
  1765  	return this
  1766  }
  1767  
  1768  func (this ConvolverNode) Ref() js.Ref {
  1769  	return this.AudioNode.Ref()
  1770  }
  1771  
  1772  func (this ConvolverNode) FromRef(ref js.Ref) ConvolverNode {
  1773  	this.AudioNode = this.AudioNode.FromRef(ref)
  1774  	return this
  1775  }
  1776  
  1777  func (this ConvolverNode) Free() {
  1778  	this.ref.Free()
  1779  }
  1780  
  1781  // Buffer returns the value of property "ConvolverNode.buffer".
  1782  //
  1783  // It returns ok=false if there is no such property.
  1784  func (this ConvolverNode) Buffer() (ret AudioBuffer, ok bool) {
  1785  	ok = js.True == bindings.GetConvolverNodeBuffer(
  1786  		this.ref, js.Pointer(&ret),
  1787  	)
  1788  	return
  1789  }
  1790  
  1791  // SetBuffer sets the value of property "ConvolverNode.buffer" to val.
  1792  //
  1793  // It returns false if the property cannot be set.
  1794  func (this ConvolverNode) SetBuffer(val AudioBuffer) bool {
  1795  	return js.True == bindings.SetConvolverNodeBuffer(
  1796  		this.ref,
  1797  		val.Ref(),
  1798  	)
  1799  }
  1800  
  1801  // Normalize returns the value of property "ConvolverNode.normalize".
  1802  //
  1803  // It returns ok=false if there is no such property.
  1804  func (this ConvolverNode) Normalize() (ret bool, ok bool) {
  1805  	ok = js.True == bindings.GetConvolverNodeNormalize(
  1806  		this.ref, js.Pointer(&ret),
  1807  	)
  1808  	return
  1809  }
  1810  
  1811  // SetNormalize sets the value of property "ConvolverNode.normalize" to val.
  1812  //
  1813  // It returns false if the property cannot be set.
  1814  func (this ConvolverNode) SetNormalize(val bool) bool {
  1815  	return js.True == bindings.SetConvolverNodeNormalize(
  1816  		this.ref,
  1817  		js.Bool(bool(val)),
  1818  	)
  1819  }
  1820  
  1821  type DelayOptions struct {
  1822  	// MaxDelayTime is "DelayOptions.maxDelayTime"
  1823  	//
  1824  	// Optional, defaults to 1.
  1825  	//
  1826  	// NOTE: FFI_USE_MaxDelayTime MUST be set to true to make this field effective.
  1827  	MaxDelayTime float64
  1828  	// DelayTime is "DelayOptions.delayTime"
  1829  	//
  1830  	// Optional, defaults to 0.
  1831  	//
  1832  	// NOTE: FFI_USE_DelayTime MUST be set to true to make this field effective.
  1833  	DelayTime float64
  1834  	// ChannelCount is "DelayOptions.channelCount"
  1835  	//
  1836  	// Optional
  1837  	//
  1838  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
  1839  	ChannelCount uint32
  1840  	// ChannelCountMode is "DelayOptions.channelCountMode"
  1841  	//
  1842  	// Optional
  1843  	ChannelCountMode ChannelCountMode
  1844  	// ChannelInterpretation is "DelayOptions.channelInterpretation"
  1845  	//
  1846  	// Optional
  1847  	ChannelInterpretation ChannelInterpretation
  1848  
  1849  	FFI_USE_MaxDelayTime bool // for MaxDelayTime.
  1850  	FFI_USE_DelayTime    bool // for DelayTime.
  1851  	FFI_USE_ChannelCount bool // for ChannelCount.
  1852  
  1853  	FFI_USE bool
  1854  }
  1855  
  1856  // FromRef calls UpdateFrom and returns a DelayOptions with all fields set.
  1857  func (p DelayOptions) FromRef(ref js.Ref) DelayOptions {
  1858  	p.UpdateFrom(ref)
  1859  	return p
  1860  }
  1861  
  1862  // New creates a new DelayOptions in the application heap.
  1863  func (p DelayOptions) New() js.Ref {
  1864  	return bindings.DelayOptionsJSLoad(
  1865  		js.Pointer(&p), js.True, 0,
  1866  	)
  1867  }
  1868  
  1869  // UpdateFrom copies value of all fields of the heap object to p.
  1870  func (p *DelayOptions) UpdateFrom(ref js.Ref) {
  1871  	bindings.DelayOptionsJSStore(
  1872  		js.Pointer(p), ref,
  1873  	)
  1874  }
  1875  
  1876  // Update writes all fields of the p to the heap object referenced by ref.
  1877  func (p *DelayOptions) Update(ref js.Ref) {
  1878  	bindings.DelayOptionsJSLoad(
  1879  		js.Pointer(p), js.False, ref,
  1880  	)
  1881  }
  1882  
  1883  // FreeMembers frees fields with heap reference, if recursive is true
  1884  // free all heap references reachable from p.
  1885  func (p *DelayOptions) FreeMembers(recursive bool) {
  1886  }
  1887  
  1888  func NewDelayNode(context BaseAudioContext, options DelayOptions) (ret DelayNode) {
  1889  	ret.ref = bindings.NewDelayNodeByDelayNode(
  1890  		context.Ref(),
  1891  		js.Pointer(&options))
  1892  	return
  1893  }
  1894  
  1895  func NewDelayNodeByDelayNode1(context BaseAudioContext) (ret DelayNode) {
  1896  	ret.ref = bindings.NewDelayNodeByDelayNode1(
  1897  		context.Ref())
  1898  	return
  1899  }
  1900  
  1901  type DelayNode struct {
  1902  	AudioNode
  1903  }
  1904  
  1905  func (this DelayNode) Once() DelayNode {
  1906  	this.ref.Once()
  1907  	return this
  1908  }
  1909  
  1910  func (this DelayNode) Ref() js.Ref {
  1911  	return this.AudioNode.Ref()
  1912  }
  1913  
  1914  func (this DelayNode) FromRef(ref js.Ref) DelayNode {
  1915  	this.AudioNode = this.AudioNode.FromRef(ref)
  1916  	return this
  1917  }
  1918  
  1919  func (this DelayNode) Free() {
  1920  	this.ref.Free()
  1921  }
  1922  
  1923  // DelayTime returns the value of property "DelayNode.delayTime".
  1924  //
  1925  // It returns ok=false if there is no such property.
  1926  func (this DelayNode) DelayTime() (ret AudioParam, ok bool) {
  1927  	ok = js.True == bindings.GetDelayNodeDelayTime(
  1928  		this.ref, js.Pointer(&ret),
  1929  	)
  1930  	return
  1931  }
  1932  
  1933  type DynamicsCompressorOptions struct {
  1934  	// Attack is "DynamicsCompressorOptions.attack"
  1935  	//
  1936  	// Optional, defaults to 0.003.
  1937  	//
  1938  	// NOTE: FFI_USE_Attack MUST be set to true to make this field effective.
  1939  	Attack float32
  1940  	// Knee is "DynamicsCompressorOptions.knee"
  1941  	//
  1942  	// Optional, defaults to 30.
  1943  	//
  1944  	// NOTE: FFI_USE_Knee MUST be set to true to make this field effective.
  1945  	Knee float32
  1946  	// Ratio is "DynamicsCompressorOptions.ratio"
  1947  	//
  1948  	// Optional, defaults to 12.
  1949  	//
  1950  	// NOTE: FFI_USE_Ratio MUST be set to true to make this field effective.
  1951  	Ratio float32
  1952  	// Release is "DynamicsCompressorOptions.release"
  1953  	//
  1954  	// Optional, defaults to 0.25.
  1955  	//
  1956  	// NOTE: FFI_USE_Release MUST be set to true to make this field effective.
  1957  	Release float32
  1958  	// Threshold is "DynamicsCompressorOptions.threshold"
  1959  	//
  1960  	// Optional, defaults to -24.
  1961  	//
  1962  	// NOTE: FFI_USE_Threshold MUST be set to true to make this field effective.
  1963  	Threshold float32
  1964  	// ChannelCount is "DynamicsCompressorOptions.channelCount"
  1965  	//
  1966  	// Optional
  1967  	//
  1968  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
  1969  	ChannelCount uint32
  1970  	// ChannelCountMode is "DynamicsCompressorOptions.channelCountMode"
  1971  	//
  1972  	// Optional
  1973  	ChannelCountMode ChannelCountMode
  1974  	// ChannelInterpretation is "DynamicsCompressorOptions.channelInterpretation"
  1975  	//
  1976  	// Optional
  1977  	ChannelInterpretation ChannelInterpretation
  1978  
  1979  	FFI_USE_Attack       bool // for Attack.
  1980  	FFI_USE_Knee         bool // for Knee.
  1981  	FFI_USE_Ratio        bool // for Ratio.
  1982  	FFI_USE_Release      bool // for Release.
  1983  	FFI_USE_Threshold    bool // for Threshold.
  1984  	FFI_USE_ChannelCount bool // for ChannelCount.
  1985  
  1986  	FFI_USE bool
  1987  }
  1988  
  1989  // FromRef calls UpdateFrom and returns a DynamicsCompressorOptions with all fields set.
  1990  func (p DynamicsCompressorOptions) FromRef(ref js.Ref) DynamicsCompressorOptions {
  1991  	p.UpdateFrom(ref)
  1992  	return p
  1993  }
  1994  
  1995  // New creates a new DynamicsCompressorOptions in the application heap.
  1996  func (p DynamicsCompressorOptions) New() js.Ref {
  1997  	return bindings.DynamicsCompressorOptionsJSLoad(
  1998  		js.Pointer(&p), js.True, 0,
  1999  	)
  2000  }
  2001  
  2002  // UpdateFrom copies value of all fields of the heap object to p.
  2003  func (p *DynamicsCompressorOptions) UpdateFrom(ref js.Ref) {
  2004  	bindings.DynamicsCompressorOptionsJSStore(
  2005  		js.Pointer(p), ref,
  2006  	)
  2007  }
  2008  
  2009  // Update writes all fields of the p to the heap object referenced by ref.
  2010  func (p *DynamicsCompressorOptions) Update(ref js.Ref) {
  2011  	bindings.DynamicsCompressorOptionsJSLoad(
  2012  		js.Pointer(p), js.False, ref,
  2013  	)
  2014  }
  2015  
  2016  // FreeMembers frees fields with heap reference, if recursive is true
  2017  // free all heap references reachable from p.
  2018  func (p *DynamicsCompressorOptions) FreeMembers(recursive bool) {
  2019  }
  2020  
  2021  func NewDynamicsCompressorNode(context BaseAudioContext, options DynamicsCompressorOptions) (ret DynamicsCompressorNode) {
  2022  	ret.ref = bindings.NewDynamicsCompressorNodeByDynamicsCompressorNode(
  2023  		context.Ref(),
  2024  		js.Pointer(&options))
  2025  	return
  2026  }
  2027  
  2028  func NewDynamicsCompressorNodeByDynamicsCompressorNode1(context BaseAudioContext) (ret DynamicsCompressorNode) {
  2029  	ret.ref = bindings.NewDynamicsCompressorNodeByDynamicsCompressorNode1(
  2030  		context.Ref())
  2031  	return
  2032  }
  2033  
  2034  type DynamicsCompressorNode struct {
  2035  	AudioNode
  2036  }
  2037  
  2038  func (this DynamicsCompressorNode) Once() DynamicsCompressorNode {
  2039  	this.ref.Once()
  2040  	return this
  2041  }
  2042  
  2043  func (this DynamicsCompressorNode) Ref() js.Ref {
  2044  	return this.AudioNode.Ref()
  2045  }
  2046  
  2047  func (this DynamicsCompressorNode) FromRef(ref js.Ref) DynamicsCompressorNode {
  2048  	this.AudioNode = this.AudioNode.FromRef(ref)
  2049  	return this
  2050  }
  2051  
  2052  func (this DynamicsCompressorNode) Free() {
  2053  	this.ref.Free()
  2054  }
  2055  
  2056  // Threshold returns the value of property "DynamicsCompressorNode.threshold".
  2057  //
  2058  // It returns ok=false if there is no such property.
  2059  func (this DynamicsCompressorNode) Threshold() (ret AudioParam, ok bool) {
  2060  	ok = js.True == bindings.GetDynamicsCompressorNodeThreshold(
  2061  		this.ref, js.Pointer(&ret),
  2062  	)
  2063  	return
  2064  }
  2065  
  2066  // Knee returns the value of property "DynamicsCompressorNode.knee".
  2067  //
  2068  // It returns ok=false if there is no such property.
  2069  func (this DynamicsCompressorNode) Knee() (ret AudioParam, ok bool) {
  2070  	ok = js.True == bindings.GetDynamicsCompressorNodeKnee(
  2071  		this.ref, js.Pointer(&ret),
  2072  	)
  2073  	return
  2074  }
  2075  
  2076  // Ratio returns the value of property "DynamicsCompressorNode.ratio".
  2077  //
  2078  // It returns ok=false if there is no such property.
  2079  func (this DynamicsCompressorNode) Ratio() (ret AudioParam, ok bool) {
  2080  	ok = js.True == bindings.GetDynamicsCompressorNodeRatio(
  2081  		this.ref, js.Pointer(&ret),
  2082  	)
  2083  	return
  2084  }
  2085  
  2086  // Reduction returns the value of property "DynamicsCompressorNode.reduction".
  2087  //
  2088  // It returns ok=false if there is no such property.
  2089  func (this DynamicsCompressorNode) Reduction() (ret float32, ok bool) {
  2090  	ok = js.True == bindings.GetDynamicsCompressorNodeReduction(
  2091  		this.ref, js.Pointer(&ret),
  2092  	)
  2093  	return
  2094  }
  2095  
  2096  // Attack returns the value of property "DynamicsCompressorNode.attack".
  2097  //
  2098  // It returns ok=false if there is no such property.
  2099  func (this DynamicsCompressorNode) Attack() (ret AudioParam, ok bool) {
  2100  	ok = js.True == bindings.GetDynamicsCompressorNodeAttack(
  2101  		this.ref, js.Pointer(&ret),
  2102  	)
  2103  	return
  2104  }
  2105  
  2106  // Release returns the value of property "DynamicsCompressorNode.release".
  2107  //
  2108  // It returns ok=false if there is no such property.
  2109  func (this DynamicsCompressorNode) Release() (ret AudioParam, ok bool) {
  2110  	ok = js.True == bindings.GetDynamicsCompressorNodeRelease(
  2111  		this.ref, js.Pointer(&ret),
  2112  	)
  2113  	return
  2114  }
  2115  
  2116  type GainOptions struct {
  2117  	// Gain is "GainOptions.gain"
  2118  	//
  2119  	// Optional, defaults to 1.0.
  2120  	//
  2121  	// NOTE: FFI_USE_Gain MUST be set to true to make this field effective.
  2122  	Gain float32
  2123  	// ChannelCount is "GainOptions.channelCount"
  2124  	//
  2125  	// Optional
  2126  	//
  2127  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
  2128  	ChannelCount uint32
  2129  	// ChannelCountMode is "GainOptions.channelCountMode"
  2130  	//
  2131  	// Optional
  2132  	ChannelCountMode ChannelCountMode
  2133  	// ChannelInterpretation is "GainOptions.channelInterpretation"
  2134  	//
  2135  	// Optional
  2136  	ChannelInterpretation ChannelInterpretation
  2137  
  2138  	FFI_USE_Gain         bool // for Gain.
  2139  	FFI_USE_ChannelCount bool // for ChannelCount.
  2140  
  2141  	FFI_USE bool
  2142  }
  2143  
  2144  // FromRef calls UpdateFrom and returns a GainOptions with all fields set.
  2145  func (p GainOptions) FromRef(ref js.Ref) GainOptions {
  2146  	p.UpdateFrom(ref)
  2147  	return p
  2148  }
  2149  
  2150  // New creates a new GainOptions in the application heap.
  2151  func (p GainOptions) New() js.Ref {
  2152  	return bindings.GainOptionsJSLoad(
  2153  		js.Pointer(&p), js.True, 0,
  2154  	)
  2155  }
  2156  
  2157  // UpdateFrom copies value of all fields of the heap object to p.
  2158  func (p *GainOptions) UpdateFrom(ref js.Ref) {
  2159  	bindings.GainOptionsJSStore(
  2160  		js.Pointer(p), ref,
  2161  	)
  2162  }
  2163  
  2164  // Update writes all fields of the p to the heap object referenced by ref.
  2165  func (p *GainOptions) Update(ref js.Ref) {
  2166  	bindings.GainOptionsJSLoad(
  2167  		js.Pointer(p), js.False, ref,
  2168  	)
  2169  }
  2170  
  2171  // FreeMembers frees fields with heap reference, if recursive is true
  2172  // free all heap references reachable from p.
  2173  func (p *GainOptions) FreeMembers(recursive bool) {
  2174  }
  2175  
  2176  func NewGainNode(context BaseAudioContext, options GainOptions) (ret GainNode) {
  2177  	ret.ref = bindings.NewGainNodeByGainNode(
  2178  		context.Ref(),
  2179  		js.Pointer(&options))
  2180  	return
  2181  }
  2182  
  2183  func NewGainNodeByGainNode1(context BaseAudioContext) (ret GainNode) {
  2184  	ret.ref = bindings.NewGainNodeByGainNode1(
  2185  		context.Ref())
  2186  	return
  2187  }
  2188  
  2189  type GainNode struct {
  2190  	AudioNode
  2191  }
  2192  
  2193  func (this GainNode) Once() GainNode {
  2194  	this.ref.Once()
  2195  	return this
  2196  }
  2197  
  2198  func (this GainNode) Ref() js.Ref {
  2199  	return this.AudioNode.Ref()
  2200  }
  2201  
  2202  func (this GainNode) FromRef(ref js.Ref) GainNode {
  2203  	this.AudioNode = this.AudioNode.FromRef(ref)
  2204  	return this
  2205  }
  2206  
  2207  func (this GainNode) Free() {
  2208  	this.ref.Free()
  2209  }
  2210  
  2211  // Gain returns the value of property "GainNode.gain".
  2212  //
  2213  // It returns ok=false if there is no such property.
  2214  func (this GainNode) Gain() (ret AudioParam, ok bool) {
  2215  	ok = js.True == bindings.GetGainNodeGain(
  2216  		this.ref, js.Pointer(&ret),
  2217  	)
  2218  	return
  2219  }
  2220  
  2221  type IIRFilterOptions struct {
  2222  	// Feedforward is "IIRFilterOptions.feedforward"
  2223  	//
  2224  	// Required
  2225  	Feedforward js.Array[float64]
  2226  	// Feedback is "IIRFilterOptions.feedback"
  2227  	//
  2228  	// Required
  2229  	Feedback js.Array[float64]
  2230  	// ChannelCount is "IIRFilterOptions.channelCount"
  2231  	//
  2232  	// Optional
  2233  	//
  2234  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
  2235  	ChannelCount uint32
  2236  	// ChannelCountMode is "IIRFilterOptions.channelCountMode"
  2237  	//
  2238  	// Optional
  2239  	ChannelCountMode ChannelCountMode
  2240  	// ChannelInterpretation is "IIRFilterOptions.channelInterpretation"
  2241  	//
  2242  	// Optional
  2243  	ChannelInterpretation ChannelInterpretation
  2244  
  2245  	FFI_USE_ChannelCount bool // for ChannelCount.
  2246  
  2247  	FFI_USE bool
  2248  }
  2249  
  2250  // FromRef calls UpdateFrom and returns a IIRFilterOptions with all fields set.
  2251  func (p IIRFilterOptions) FromRef(ref js.Ref) IIRFilterOptions {
  2252  	p.UpdateFrom(ref)
  2253  	return p
  2254  }
  2255  
  2256  // New creates a new IIRFilterOptions in the application heap.
  2257  func (p IIRFilterOptions) New() js.Ref {
  2258  	return bindings.IIRFilterOptionsJSLoad(
  2259  		js.Pointer(&p), js.True, 0,
  2260  	)
  2261  }
  2262  
  2263  // UpdateFrom copies value of all fields of the heap object to p.
  2264  func (p *IIRFilterOptions) UpdateFrom(ref js.Ref) {
  2265  	bindings.IIRFilterOptionsJSStore(
  2266  		js.Pointer(p), ref,
  2267  	)
  2268  }
  2269  
  2270  // Update writes all fields of the p to the heap object referenced by ref.
  2271  func (p *IIRFilterOptions) Update(ref js.Ref) {
  2272  	bindings.IIRFilterOptionsJSLoad(
  2273  		js.Pointer(p), js.False, ref,
  2274  	)
  2275  }
  2276  
  2277  // FreeMembers frees fields with heap reference, if recursive is true
  2278  // free all heap references reachable from p.
  2279  func (p *IIRFilterOptions) FreeMembers(recursive bool) {
  2280  	js.Free(
  2281  		p.Feedforward.Ref(),
  2282  		p.Feedback.Ref(),
  2283  	)
  2284  	p.Feedforward = p.Feedforward.FromRef(js.Undefined)
  2285  	p.Feedback = p.Feedback.FromRef(js.Undefined)
  2286  }
  2287  
  2288  func NewIIRFilterNode(context BaseAudioContext, options IIRFilterOptions) (ret IIRFilterNode) {
  2289  	ret.ref = bindings.NewIIRFilterNodeByIIRFilterNode(
  2290  		context.Ref(),
  2291  		js.Pointer(&options))
  2292  	return
  2293  }
  2294  
  2295  type IIRFilterNode struct {
  2296  	AudioNode
  2297  }
  2298  
  2299  func (this IIRFilterNode) Once() IIRFilterNode {
  2300  	this.ref.Once()
  2301  	return this
  2302  }
  2303  
  2304  func (this IIRFilterNode) Ref() js.Ref {
  2305  	return this.AudioNode.Ref()
  2306  }
  2307  
  2308  func (this IIRFilterNode) FromRef(ref js.Ref) IIRFilterNode {
  2309  	this.AudioNode = this.AudioNode.FromRef(ref)
  2310  	return this
  2311  }
  2312  
  2313  func (this IIRFilterNode) Free() {
  2314  	this.ref.Free()
  2315  }
  2316  
  2317  // HasFuncGetFrequencyResponse returns true if the method "IIRFilterNode.getFrequencyResponse" exists.
  2318  func (this IIRFilterNode) HasFuncGetFrequencyResponse() bool {
  2319  	return js.True == bindings.HasFuncIIRFilterNodeGetFrequencyResponse(
  2320  		this.ref,
  2321  	)
  2322  }
  2323  
  2324  // FuncGetFrequencyResponse returns the method "IIRFilterNode.getFrequencyResponse".
  2325  func (this IIRFilterNode) FuncGetFrequencyResponse() (fn js.Func[func(frequencyHz js.TypedArray[float32], magResponse js.TypedArray[float32], phaseResponse js.TypedArray[float32])]) {
  2326  	bindings.FuncIIRFilterNodeGetFrequencyResponse(
  2327  		this.ref, js.Pointer(&fn),
  2328  	)
  2329  	return
  2330  }
  2331  
  2332  // GetFrequencyResponse calls the method "IIRFilterNode.getFrequencyResponse".
  2333  func (this IIRFilterNode) GetFrequencyResponse(frequencyHz js.TypedArray[float32], magResponse js.TypedArray[float32], phaseResponse js.TypedArray[float32]) (ret js.Void) {
  2334  	bindings.CallIIRFilterNodeGetFrequencyResponse(
  2335  		this.ref, js.Pointer(&ret),
  2336  		frequencyHz.Ref(),
  2337  		magResponse.Ref(),
  2338  		phaseResponse.Ref(),
  2339  	)
  2340  
  2341  	return
  2342  }
  2343  
  2344  // TryGetFrequencyResponse calls the method "IIRFilterNode.getFrequencyResponse"
  2345  // in a try/catch block and returns (_, err, ok = false) when it went through
  2346  // the catch clause.
  2347  func (this IIRFilterNode) TryGetFrequencyResponse(frequencyHz js.TypedArray[float32], magResponse js.TypedArray[float32], phaseResponse js.TypedArray[float32]) (ret js.Void, exception js.Any, ok bool) {
  2348  	ok = js.True == bindings.TryIIRFilterNodeGetFrequencyResponse(
  2349  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2350  		frequencyHz.Ref(),
  2351  		magResponse.Ref(),
  2352  		phaseResponse.Ref(),
  2353  	)
  2354  
  2355  	return
  2356  }
  2357  
  2358  type OscillatorType uint32
  2359  
  2360  const (
  2361  	_ OscillatorType = iota
  2362  
  2363  	OscillatorType_SINE
  2364  	OscillatorType_SQUARE
  2365  	OscillatorType_SAWTOOTH
  2366  	OscillatorType_TRIANGLE
  2367  	OscillatorType_CUSTOM
  2368  )
  2369  
  2370  func (OscillatorType) FromRef(str js.Ref) OscillatorType {
  2371  	return OscillatorType(bindings.ConstOfOscillatorType(str))
  2372  }
  2373  
  2374  func (x OscillatorType) String() (string, bool) {
  2375  	switch x {
  2376  	case OscillatorType_SINE:
  2377  		return "sine", true
  2378  	case OscillatorType_SQUARE:
  2379  		return "square", true
  2380  	case OscillatorType_SAWTOOTH:
  2381  		return "sawtooth", true
  2382  	case OscillatorType_TRIANGLE:
  2383  		return "triangle", true
  2384  	case OscillatorType_CUSTOM:
  2385  		return "custom", true
  2386  	default:
  2387  		return "", false
  2388  	}
  2389  }
  2390  
  2391  type PeriodicWaveOptions struct {
  2392  	// Real is "PeriodicWaveOptions.real"
  2393  	//
  2394  	// Optional
  2395  	Real js.Array[float32]
  2396  	// Imag is "PeriodicWaveOptions.imag"
  2397  	//
  2398  	// Optional
  2399  	Imag js.Array[float32]
  2400  	// DisableNormalization is "PeriodicWaveOptions.disableNormalization"
  2401  	//
  2402  	// Optional, defaults to false.
  2403  	//
  2404  	// NOTE: FFI_USE_DisableNormalization MUST be set to true to make this field effective.
  2405  	DisableNormalization bool
  2406  
  2407  	FFI_USE_DisableNormalization bool // for DisableNormalization.
  2408  
  2409  	FFI_USE bool
  2410  }
  2411  
  2412  // FromRef calls UpdateFrom and returns a PeriodicWaveOptions with all fields set.
  2413  func (p PeriodicWaveOptions) FromRef(ref js.Ref) PeriodicWaveOptions {
  2414  	p.UpdateFrom(ref)
  2415  	return p
  2416  }
  2417  
  2418  // New creates a new PeriodicWaveOptions in the application heap.
  2419  func (p PeriodicWaveOptions) New() js.Ref {
  2420  	return bindings.PeriodicWaveOptionsJSLoad(
  2421  		js.Pointer(&p), js.True, 0,
  2422  	)
  2423  }
  2424  
  2425  // UpdateFrom copies value of all fields of the heap object to p.
  2426  func (p *PeriodicWaveOptions) UpdateFrom(ref js.Ref) {
  2427  	bindings.PeriodicWaveOptionsJSStore(
  2428  		js.Pointer(p), ref,
  2429  	)
  2430  }
  2431  
  2432  // Update writes all fields of the p to the heap object referenced by ref.
  2433  func (p *PeriodicWaveOptions) Update(ref js.Ref) {
  2434  	bindings.PeriodicWaveOptionsJSLoad(
  2435  		js.Pointer(p), js.False, ref,
  2436  	)
  2437  }
  2438  
  2439  // FreeMembers frees fields with heap reference, if recursive is true
  2440  // free all heap references reachable from p.
  2441  func (p *PeriodicWaveOptions) FreeMembers(recursive bool) {
  2442  	js.Free(
  2443  		p.Real.Ref(),
  2444  		p.Imag.Ref(),
  2445  	)
  2446  	p.Real = p.Real.FromRef(js.Undefined)
  2447  	p.Imag = p.Imag.FromRef(js.Undefined)
  2448  }
  2449  
  2450  func NewPeriodicWave(context BaseAudioContext, options PeriodicWaveOptions) (ret PeriodicWave) {
  2451  	ret.ref = bindings.NewPeriodicWaveByPeriodicWave(
  2452  		context.Ref(),
  2453  		js.Pointer(&options))
  2454  	return
  2455  }
  2456  
  2457  func NewPeriodicWaveByPeriodicWave1(context BaseAudioContext) (ret PeriodicWave) {
  2458  	ret.ref = bindings.NewPeriodicWaveByPeriodicWave1(
  2459  		context.Ref())
  2460  	return
  2461  }
  2462  
  2463  type PeriodicWave struct {
  2464  	ref js.Ref
  2465  }
  2466  
  2467  func (this PeriodicWave) Once() PeriodicWave {
  2468  	this.ref.Once()
  2469  	return this
  2470  }
  2471  
  2472  func (this PeriodicWave) Ref() js.Ref {
  2473  	return this.ref
  2474  }
  2475  
  2476  func (this PeriodicWave) FromRef(ref js.Ref) PeriodicWave {
  2477  	this.ref = ref
  2478  	return this
  2479  }
  2480  
  2481  func (this PeriodicWave) Free() {
  2482  	this.ref.Free()
  2483  }
  2484  
  2485  type OscillatorOptions struct {
  2486  	// Type is "OscillatorOptions.type"
  2487  	//
  2488  	// Optional, defaults to "sine".
  2489  	Type OscillatorType
  2490  	// Frequency is "OscillatorOptions.frequency"
  2491  	//
  2492  	// Optional, defaults to 440.
  2493  	//
  2494  	// NOTE: FFI_USE_Frequency MUST be set to true to make this field effective.
  2495  	Frequency float32
  2496  	// Detune is "OscillatorOptions.detune"
  2497  	//
  2498  	// Optional, defaults to 0.
  2499  	//
  2500  	// NOTE: FFI_USE_Detune MUST be set to true to make this field effective.
  2501  	Detune float32
  2502  	// PeriodicWave is "OscillatorOptions.periodicWave"
  2503  	//
  2504  	// Optional
  2505  	PeriodicWave PeriodicWave
  2506  	// ChannelCount is "OscillatorOptions.channelCount"
  2507  	//
  2508  	// Optional
  2509  	//
  2510  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
  2511  	ChannelCount uint32
  2512  	// ChannelCountMode is "OscillatorOptions.channelCountMode"
  2513  	//
  2514  	// Optional
  2515  	ChannelCountMode ChannelCountMode
  2516  	// ChannelInterpretation is "OscillatorOptions.channelInterpretation"
  2517  	//
  2518  	// Optional
  2519  	ChannelInterpretation ChannelInterpretation
  2520  
  2521  	FFI_USE_Frequency    bool // for Frequency.
  2522  	FFI_USE_Detune       bool // for Detune.
  2523  	FFI_USE_ChannelCount bool // for ChannelCount.
  2524  
  2525  	FFI_USE bool
  2526  }
  2527  
  2528  // FromRef calls UpdateFrom and returns a OscillatorOptions with all fields set.
  2529  func (p OscillatorOptions) FromRef(ref js.Ref) OscillatorOptions {
  2530  	p.UpdateFrom(ref)
  2531  	return p
  2532  }
  2533  
  2534  // New creates a new OscillatorOptions in the application heap.
  2535  func (p OscillatorOptions) New() js.Ref {
  2536  	return bindings.OscillatorOptionsJSLoad(
  2537  		js.Pointer(&p), js.True, 0,
  2538  	)
  2539  }
  2540  
  2541  // UpdateFrom copies value of all fields of the heap object to p.
  2542  func (p *OscillatorOptions) UpdateFrom(ref js.Ref) {
  2543  	bindings.OscillatorOptionsJSStore(
  2544  		js.Pointer(p), ref,
  2545  	)
  2546  }
  2547  
  2548  // Update writes all fields of the p to the heap object referenced by ref.
  2549  func (p *OscillatorOptions) Update(ref js.Ref) {
  2550  	bindings.OscillatorOptionsJSLoad(
  2551  		js.Pointer(p), js.False, ref,
  2552  	)
  2553  }
  2554  
  2555  // FreeMembers frees fields with heap reference, if recursive is true
  2556  // free all heap references reachable from p.
  2557  func (p *OscillatorOptions) FreeMembers(recursive bool) {
  2558  	js.Free(
  2559  		p.PeriodicWave.Ref(),
  2560  	)
  2561  	p.PeriodicWave = p.PeriodicWave.FromRef(js.Undefined)
  2562  }
  2563  
  2564  func NewOscillatorNode(context BaseAudioContext, options OscillatorOptions) (ret OscillatorNode) {
  2565  	ret.ref = bindings.NewOscillatorNodeByOscillatorNode(
  2566  		context.Ref(),
  2567  		js.Pointer(&options))
  2568  	return
  2569  }
  2570  
  2571  func NewOscillatorNodeByOscillatorNode1(context BaseAudioContext) (ret OscillatorNode) {
  2572  	ret.ref = bindings.NewOscillatorNodeByOscillatorNode1(
  2573  		context.Ref())
  2574  	return
  2575  }
  2576  
  2577  type OscillatorNode struct {
  2578  	AudioScheduledSourceNode
  2579  }
  2580  
  2581  func (this OscillatorNode) Once() OscillatorNode {
  2582  	this.ref.Once()
  2583  	return this
  2584  }
  2585  
  2586  func (this OscillatorNode) Ref() js.Ref {
  2587  	return this.AudioScheduledSourceNode.Ref()
  2588  }
  2589  
  2590  func (this OscillatorNode) FromRef(ref js.Ref) OscillatorNode {
  2591  	this.AudioScheduledSourceNode = this.AudioScheduledSourceNode.FromRef(ref)
  2592  	return this
  2593  }
  2594  
  2595  func (this OscillatorNode) Free() {
  2596  	this.ref.Free()
  2597  }
  2598  
  2599  // Type returns the value of property "OscillatorNode.type".
  2600  //
  2601  // It returns ok=false if there is no such property.
  2602  func (this OscillatorNode) Type() (ret OscillatorType, ok bool) {
  2603  	ok = js.True == bindings.GetOscillatorNodeType(
  2604  		this.ref, js.Pointer(&ret),
  2605  	)
  2606  	return
  2607  }
  2608  
  2609  // SetType sets the value of property "OscillatorNode.type" to val.
  2610  //
  2611  // It returns false if the property cannot be set.
  2612  func (this OscillatorNode) SetType(val OscillatorType) bool {
  2613  	return js.True == bindings.SetOscillatorNodeType(
  2614  		this.ref,
  2615  		uint32(val),
  2616  	)
  2617  }
  2618  
  2619  // Frequency returns the value of property "OscillatorNode.frequency".
  2620  //
  2621  // It returns ok=false if there is no such property.
  2622  func (this OscillatorNode) Frequency() (ret AudioParam, ok bool) {
  2623  	ok = js.True == bindings.GetOscillatorNodeFrequency(
  2624  		this.ref, js.Pointer(&ret),
  2625  	)
  2626  	return
  2627  }
  2628  
  2629  // Detune returns the value of property "OscillatorNode.detune".
  2630  //
  2631  // It returns ok=false if there is no such property.
  2632  func (this OscillatorNode) Detune() (ret AudioParam, ok bool) {
  2633  	ok = js.True == bindings.GetOscillatorNodeDetune(
  2634  		this.ref, js.Pointer(&ret),
  2635  	)
  2636  	return
  2637  }
  2638  
  2639  // HasFuncSetPeriodicWave returns true if the method "OscillatorNode.setPeriodicWave" exists.
  2640  func (this OscillatorNode) HasFuncSetPeriodicWave() bool {
  2641  	return js.True == bindings.HasFuncOscillatorNodeSetPeriodicWave(
  2642  		this.ref,
  2643  	)
  2644  }
  2645  
  2646  // FuncSetPeriodicWave returns the method "OscillatorNode.setPeriodicWave".
  2647  func (this OscillatorNode) FuncSetPeriodicWave() (fn js.Func[func(periodicWave PeriodicWave)]) {
  2648  	bindings.FuncOscillatorNodeSetPeriodicWave(
  2649  		this.ref, js.Pointer(&fn),
  2650  	)
  2651  	return
  2652  }
  2653  
  2654  // SetPeriodicWave calls the method "OscillatorNode.setPeriodicWave".
  2655  func (this OscillatorNode) SetPeriodicWave(periodicWave PeriodicWave) (ret js.Void) {
  2656  	bindings.CallOscillatorNodeSetPeriodicWave(
  2657  		this.ref, js.Pointer(&ret),
  2658  		periodicWave.Ref(),
  2659  	)
  2660  
  2661  	return
  2662  }
  2663  
  2664  // TrySetPeriodicWave calls the method "OscillatorNode.setPeriodicWave"
  2665  // in a try/catch block and returns (_, err, ok = false) when it went through
  2666  // the catch clause.
  2667  func (this OscillatorNode) TrySetPeriodicWave(periodicWave PeriodicWave) (ret js.Void, exception js.Any, ok bool) {
  2668  	ok = js.True == bindings.TryOscillatorNodeSetPeriodicWave(
  2669  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2670  		periodicWave.Ref(),
  2671  	)
  2672  
  2673  	return
  2674  }
  2675  
  2676  type PanningModelType uint32
  2677  
  2678  const (
  2679  	_ PanningModelType = iota
  2680  
  2681  	PanningModelType_EQUALPOWER
  2682  	PanningModelType_HRTF
  2683  )
  2684  
  2685  func (PanningModelType) FromRef(str js.Ref) PanningModelType {
  2686  	return PanningModelType(bindings.ConstOfPanningModelType(str))
  2687  }
  2688  
  2689  func (x PanningModelType) String() (string, bool) {
  2690  	switch x {
  2691  	case PanningModelType_EQUALPOWER:
  2692  		return "equalpower", true
  2693  	case PanningModelType_HRTF:
  2694  		return "HRTF", true
  2695  	default:
  2696  		return "", false
  2697  	}
  2698  }
  2699  
  2700  type DistanceModelType uint32
  2701  
  2702  const (
  2703  	_ DistanceModelType = iota
  2704  
  2705  	DistanceModelType_LINEAR
  2706  	DistanceModelType_INVERSE
  2707  	DistanceModelType_EXPONENTIAL
  2708  )
  2709  
  2710  func (DistanceModelType) FromRef(str js.Ref) DistanceModelType {
  2711  	return DistanceModelType(bindings.ConstOfDistanceModelType(str))
  2712  }
  2713  
  2714  func (x DistanceModelType) String() (string, bool) {
  2715  	switch x {
  2716  	case DistanceModelType_LINEAR:
  2717  		return "linear", true
  2718  	case DistanceModelType_INVERSE:
  2719  		return "inverse", true
  2720  	case DistanceModelType_EXPONENTIAL:
  2721  		return "exponential", true
  2722  	default:
  2723  		return "", false
  2724  	}
  2725  }
  2726  
  2727  type PannerOptions struct {
  2728  	// PanningModel is "PannerOptions.panningModel"
  2729  	//
  2730  	// Optional, defaults to "equalpower".
  2731  	PanningModel PanningModelType
  2732  	// DistanceModel is "PannerOptions.distanceModel"
  2733  	//
  2734  	// Optional, defaults to "inverse".
  2735  	DistanceModel DistanceModelType
  2736  	// PositionX is "PannerOptions.positionX"
  2737  	//
  2738  	// Optional, defaults to 0.
  2739  	//
  2740  	// NOTE: FFI_USE_PositionX MUST be set to true to make this field effective.
  2741  	PositionX float32
  2742  	// PositionY is "PannerOptions.positionY"
  2743  	//
  2744  	// Optional, defaults to 0.
  2745  	//
  2746  	// NOTE: FFI_USE_PositionY MUST be set to true to make this field effective.
  2747  	PositionY float32
  2748  	// PositionZ is "PannerOptions.positionZ"
  2749  	//
  2750  	// Optional, defaults to 0.
  2751  	//
  2752  	// NOTE: FFI_USE_PositionZ MUST be set to true to make this field effective.
  2753  	PositionZ float32
  2754  	// OrientationX is "PannerOptions.orientationX"
  2755  	//
  2756  	// Optional, defaults to 1.
  2757  	//
  2758  	// NOTE: FFI_USE_OrientationX MUST be set to true to make this field effective.
  2759  	OrientationX float32
  2760  	// OrientationY is "PannerOptions.orientationY"
  2761  	//
  2762  	// Optional, defaults to 0.
  2763  	//
  2764  	// NOTE: FFI_USE_OrientationY MUST be set to true to make this field effective.
  2765  	OrientationY float32
  2766  	// OrientationZ is "PannerOptions.orientationZ"
  2767  	//
  2768  	// Optional, defaults to 0.
  2769  	//
  2770  	// NOTE: FFI_USE_OrientationZ MUST be set to true to make this field effective.
  2771  	OrientationZ float32
  2772  	// RefDistance is "PannerOptions.refDistance"
  2773  	//
  2774  	// Optional, defaults to 1.
  2775  	//
  2776  	// NOTE: FFI_USE_RefDistance MUST be set to true to make this field effective.
  2777  	RefDistance float64
  2778  	// MaxDistance is "PannerOptions.maxDistance"
  2779  	//
  2780  	// Optional, defaults to 10000.
  2781  	//
  2782  	// NOTE: FFI_USE_MaxDistance MUST be set to true to make this field effective.
  2783  	MaxDistance float64
  2784  	// RolloffFactor is "PannerOptions.rolloffFactor"
  2785  	//
  2786  	// Optional, defaults to 1.
  2787  	//
  2788  	// NOTE: FFI_USE_RolloffFactor MUST be set to true to make this field effective.
  2789  	RolloffFactor float64
  2790  	// ConeInnerAngle is "PannerOptions.coneInnerAngle"
  2791  	//
  2792  	// Optional, defaults to 360.
  2793  	//
  2794  	// NOTE: FFI_USE_ConeInnerAngle MUST be set to true to make this field effective.
  2795  	ConeInnerAngle float64
  2796  	// ConeOuterAngle is "PannerOptions.coneOuterAngle"
  2797  	//
  2798  	// Optional, defaults to 360.
  2799  	//
  2800  	// NOTE: FFI_USE_ConeOuterAngle MUST be set to true to make this field effective.
  2801  	ConeOuterAngle float64
  2802  	// ConeOuterGain is "PannerOptions.coneOuterGain"
  2803  	//
  2804  	// Optional, defaults to 0.
  2805  	//
  2806  	// NOTE: FFI_USE_ConeOuterGain MUST be set to true to make this field effective.
  2807  	ConeOuterGain float64
  2808  	// ChannelCount is "PannerOptions.channelCount"
  2809  	//
  2810  	// Optional
  2811  	//
  2812  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
  2813  	ChannelCount uint32
  2814  	// ChannelCountMode is "PannerOptions.channelCountMode"
  2815  	//
  2816  	// Optional
  2817  	ChannelCountMode ChannelCountMode
  2818  	// ChannelInterpretation is "PannerOptions.channelInterpretation"
  2819  	//
  2820  	// Optional
  2821  	ChannelInterpretation ChannelInterpretation
  2822  
  2823  	FFI_USE_PositionX      bool // for PositionX.
  2824  	FFI_USE_PositionY      bool // for PositionY.
  2825  	FFI_USE_PositionZ      bool // for PositionZ.
  2826  	FFI_USE_OrientationX   bool // for OrientationX.
  2827  	FFI_USE_OrientationY   bool // for OrientationY.
  2828  	FFI_USE_OrientationZ   bool // for OrientationZ.
  2829  	FFI_USE_RefDistance    bool // for RefDistance.
  2830  	FFI_USE_MaxDistance    bool // for MaxDistance.
  2831  	FFI_USE_RolloffFactor  bool // for RolloffFactor.
  2832  	FFI_USE_ConeInnerAngle bool // for ConeInnerAngle.
  2833  	FFI_USE_ConeOuterAngle bool // for ConeOuterAngle.
  2834  	FFI_USE_ConeOuterGain  bool // for ConeOuterGain.
  2835  	FFI_USE_ChannelCount   bool // for ChannelCount.
  2836  
  2837  	FFI_USE bool
  2838  }
  2839  
  2840  // FromRef calls UpdateFrom and returns a PannerOptions with all fields set.
  2841  func (p PannerOptions) FromRef(ref js.Ref) PannerOptions {
  2842  	p.UpdateFrom(ref)
  2843  	return p
  2844  }
  2845  
  2846  // New creates a new PannerOptions in the application heap.
  2847  func (p PannerOptions) New() js.Ref {
  2848  	return bindings.PannerOptionsJSLoad(
  2849  		js.Pointer(&p), js.True, 0,
  2850  	)
  2851  }
  2852  
  2853  // UpdateFrom copies value of all fields of the heap object to p.
  2854  func (p *PannerOptions) UpdateFrom(ref js.Ref) {
  2855  	bindings.PannerOptionsJSStore(
  2856  		js.Pointer(p), ref,
  2857  	)
  2858  }
  2859  
  2860  // Update writes all fields of the p to the heap object referenced by ref.
  2861  func (p *PannerOptions) Update(ref js.Ref) {
  2862  	bindings.PannerOptionsJSLoad(
  2863  		js.Pointer(p), js.False, ref,
  2864  	)
  2865  }
  2866  
  2867  // FreeMembers frees fields with heap reference, if recursive is true
  2868  // free all heap references reachable from p.
  2869  func (p *PannerOptions) FreeMembers(recursive bool) {
  2870  }
  2871  
  2872  func NewPannerNode(context BaseAudioContext, options PannerOptions) (ret PannerNode) {
  2873  	ret.ref = bindings.NewPannerNodeByPannerNode(
  2874  		context.Ref(),
  2875  		js.Pointer(&options))
  2876  	return
  2877  }
  2878  
  2879  func NewPannerNodeByPannerNode1(context BaseAudioContext) (ret PannerNode) {
  2880  	ret.ref = bindings.NewPannerNodeByPannerNode1(
  2881  		context.Ref())
  2882  	return
  2883  }
  2884  
  2885  type PannerNode struct {
  2886  	AudioNode
  2887  }
  2888  
  2889  func (this PannerNode) Once() PannerNode {
  2890  	this.ref.Once()
  2891  	return this
  2892  }
  2893  
  2894  func (this PannerNode) Ref() js.Ref {
  2895  	return this.AudioNode.Ref()
  2896  }
  2897  
  2898  func (this PannerNode) FromRef(ref js.Ref) PannerNode {
  2899  	this.AudioNode = this.AudioNode.FromRef(ref)
  2900  	return this
  2901  }
  2902  
  2903  func (this PannerNode) Free() {
  2904  	this.ref.Free()
  2905  }
  2906  
  2907  // PanningModel returns the value of property "PannerNode.panningModel".
  2908  //
  2909  // It returns ok=false if there is no such property.
  2910  func (this PannerNode) PanningModel() (ret PanningModelType, ok bool) {
  2911  	ok = js.True == bindings.GetPannerNodePanningModel(
  2912  		this.ref, js.Pointer(&ret),
  2913  	)
  2914  	return
  2915  }
  2916  
  2917  // SetPanningModel sets the value of property "PannerNode.panningModel" to val.
  2918  //
  2919  // It returns false if the property cannot be set.
  2920  func (this PannerNode) SetPanningModel(val PanningModelType) bool {
  2921  	return js.True == bindings.SetPannerNodePanningModel(
  2922  		this.ref,
  2923  		uint32(val),
  2924  	)
  2925  }
  2926  
  2927  // PositionX returns the value of property "PannerNode.positionX".
  2928  //
  2929  // It returns ok=false if there is no such property.
  2930  func (this PannerNode) PositionX() (ret AudioParam, ok bool) {
  2931  	ok = js.True == bindings.GetPannerNodePositionX(
  2932  		this.ref, js.Pointer(&ret),
  2933  	)
  2934  	return
  2935  }
  2936  
  2937  // PositionY returns the value of property "PannerNode.positionY".
  2938  //
  2939  // It returns ok=false if there is no such property.
  2940  func (this PannerNode) PositionY() (ret AudioParam, ok bool) {
  2941  	ok = js.True == bindings.GetPannerNodePositionY(
  2942  		this.ref, js.Pointer(&ret),
  2943  	)
  2944  	return
  2945  }
  2946  
  2947  // PositionZ returns the value of property "PannerNode.positionZ".
  2948  //
  2949  // It returns ok=false if there is no such property.
  2950  func (this PannerNode) PositionZ() (ret AudioParam, ok bool) {
  2951  	ok = js.True == bindings.GetPannerNodePositionZ(
  2952  		this.ref, js.Pointer(&ret),
  2953  	)
  2954  	return
  2955  }
  2956  
  2957  // OrientationX returns the value of property "PannerNode.orientationX".
  2958  //
  2959  // It returns ok=false if there is no such property.
  2960  func (this PannerNode) OrientationX() (ret AudioParam, ok bool) {
  2961  	ok = js.True == bindings.GetPannerNodeOrientationX(
  2962  		this.ref, js.Pointer(&ret),
  2963  	)
  2964  	return
  2965  }
  2966  
  2967  // OrientationY returns the value of property "PannerNode.orientationY".
  2968  //
  2969  // It returns ok=false if there is no such property.
  2970  func (this PannerNode) OrientationY() (ret AudioParam, ok bool) {
  2971  	ok = js.True == bindings.GetPannerNodeOrientationY(
  2972  		this.ref, js.Pointer(&ret),
  2973  	)
  2974  	return
  2975  }
  2976  
  2977  // OrientationZ returns the value of property "PannerNode.orientationZ".
  2978  //
  2979  // It returns ok=false if there is no such property.
  2980  func (this PannerNode) OrientationZ() (ret AudioParam, ok bool) {
  2981  	ok = js.True == bindings.GetPannerNodeOrientationZ(
  2982  		this.ref, js.Pointer(&ret),
  2983  	)
  2984  	return
  2985  }
  2986  
  2987  // DistanceModel returns the value of property "PannerNode.distanceModel".
  2988  //
  2989  // It returns ok=false if there is no such property.
  2990  func (this PannerNode) DistanceModel() (ret DistanceModelType, ok bool) {
  2991  	ok = js.True == bindings.GetPannerNodeDistanceModel(
  2992  		this.ref, js.Pointer(&ret),
  2993  	)
  2994  	return
  2995  }
  2996  
  2997  // SetDistanceModel sets the value of property "PannerNode.distanceModel" to val.
  2998  //
  2999  // It returns false if the property cannot be set.
  3000  func (this PannerNode) SetDistanceModel(val DistanceModelType) bool {
  3001  	return js.True == bindings.SetPannerNodeDistanceModel(
  3002  		this.ref,
  3003  		uint32(val),
  3004  	)
  3005  }
  3006  
  3007  // RefDistance returns the value of property "PannerNode.refDistance".
  3008  //
  3009  // It returns ok=false if there is no such property.
  3010  func (this PannerNode) RefDistance() (ret float64, ok bool) {
  3011  	ok = js.True == bindings.GetPannerNodeRefDistance(
  3012  		this.ref, js.Pointer(&ret),
  3013  	)
  3014  	return
  3015  }
  3016  
  3017  // SetRefDistance sets the value of property "PannerNode.refDistance" to val.
  3018  //
  3019  // It returns false if the property cannot be set.
  3020  func (this PannerNode) SetRefDistance(val float64) bool {
  3021  	return js.True == bindings.SetPannerNodeRefDistance(
  3022  		this.ref,
  3023  		float64(val),
  3024  	)
  3025  }
  3026  
  3027  // MaxDistance returns the value of property "PannerNode.maxDistance".
  3028  //
  3029  // It returns ok=false if there is no such property.
  3030  func (this PannerNode) MaxDistance() (ret float64, ok bool) {
  3031  	ok = js.True == bindings.GetPannerNodeMaxDistance(
  3032  		this.ref, js.Pointer(&ret),
  3033  	)
  3034  	return
  3035  }
  3036  
  3037  // SetMaxDistance sets the value of property "PannerNode.maxDistance" to val.
  3038  //
  3039  // It returns false if the property cannot be set.
  3040  func (this PannerNode) SetMaxDistance(val float64) bool {
  3041  	return js.True == bindings.SetPannerNodeMaxDistance(
  3042  		this.ref,
  3043  		float64(val),
  3044  	)
  3045  }
  3046  
  3047  // RolloffFactor returns the value of property "PannerNode.rolloffFactor".
  3048  //
  3049  // It returns ok=false if there is no such property.
  3050  func (this PannerNode) RolloffFactor() (ret float64, ok bool) {
  3051  	ok = js.True == bindings.GetPannerNodeRolloffFactor(
  3052  		this.ref, js.Pointer(&ret),
  3053  	)
  3054  	return
  3055  }
  3056  
  3057  // SetRolloffFactor sets the value of property "PannerNode.rolloffFactor" to val.
  3058  //
  3059  // It returns false if the property cannot be set.
  3060  func (this PannerNode) SetRolloffFactor(val float64) bool {
  3061  	return js.True == bindings.SetPannerNodeRolloffFactor(
  3062  		this.ref,
  3063  		float64(val),
  3064  	)
  3065  }
  3066  
  3067  // ConeInnerAngle returns the value of property "PannerNode.coneInnerAngle".
  3068  //
  3069  // It returns ok=false if there is no such property.
  3070  func (this PannerNode) ConeInnerAngle() (ret float64, ok bool) {
  3071  	ok = js.True == bindings.GetPannerNodeConeInnerAngle(
  3072  		this.ref, js.Pointer(&ret),
  3073  	)
  3074  	return
  3075  }
  3076  
  3077  // SetConeInnerAngle sets the value of property "PannerNode.coneInnerAngle" to val.
  3078  //
  3079  // It returns false if the property cannot be set.
  3080  func (this PannerNode) SetConeInnerAngle(val float64) bool {
  3081  	return js.True == bindings.SetPannerNodeConeInnerAngle(
  3082  		this.ref,
  3083  		float64(val),
  3084  	)
  3085  }
  3086  
  3087  // ConeOuterAngle returns the value of property "PannerNode.coneOuterAngle".
  3088  //
  3089  // It returns ok=false if there is no such property.
  3090  func (this PannerNode) ConeOuterAngle() (ret float64, ok bool) {
  3091  	ok = js.True == bindings.GetPannerNodeConeOuterAngle(
  3092  		this.ref, js.Pointer(&ret),
  3093  	)
  3094  	return
  3095  }
  3096  
  3097  // SetConeOuterAngle sets the value of property "PannerNode.coneOuterAngle" to val.
  3098  //
  3099  // It returns false if the property cannot be set.
  3100  func (this PannerNode) SetConeOuterAngle(val float64) bool {
  3101  	return js.True == bindings.SetPannerNodeConeOuterAngle(
  3102  		this.ref,
  3103  		float64(val),
  3104  	)
  3105  }
  3106  
  3107  // ConeOuterGain returns the value of property "PannerNode.coneOuterGain".
  3108  //
  3109  // It returns ok=false if there is no such property.
  3110  func (this PannerNode) ConeOuterGain() (ret float64, ok bool) {
  3111  	ok = js.True == bindings.GetPannerNodeConeOuterGain(
  3112  		this.ref, js.Pointer(&ret),
  3113  	)
  3114  	return
  3115  }
  3116  
  3117  // SetConeOuterGain sets the value of property "PannerNode.coneOuterGain" to val.
  3118  //
  3119  // It returns false if the property cannot be set.
  3120  func (this PannerNode) SetConeOuterGain(val float64) bool {
  3121  	return js.True == bindings.SetPannerNodeConeOuterGain(
  3122  		this.ref,
  3123  		float64(val),
  3124  	)
  3125  }
  3126  
  3127  // HasFuncSetPosition returns true if the method "PannerNode.setPosition" exists.
  3128  func (this PannerNode) HasFuncSetPosition() bool {
  3129  	return js.True == bindings.HasFuncPannerNodeSetPosition(
  3130  		this.ref,
  3131  	)
  3132  }
  3133  
  3134  // FuncSetPosition returns the method "PannerNode.setPosition".
  3135  func (this PannerNode) FuncSetPosition() (fn js.Func[func(x float32, y float32, z float32)]) {
  3136  	bindings.FuncPannerNodeSetPosition(
  3137  		this.ref, js.Pointer(&fn),
  3138  	)
  3139  	return
  3140  }
  3141  
  3142  // SetPosition calls the method "PannerNode.setPosition".
  3143  func (this PannerNode) SetPosition(x float32, y float32, z float32) (ret js.Void) {
  3144  	bindings.CallPannerNodeSetPosition(
  3145  		this.ref, js.Pointer(&ret),
  3146  		float32(x),
  3147  		float32(y),
  3148  		float32(z),
  3149  	)
  3150  
  3151  	return
  3152  }
  3153  
  3154  // TrySetPosition calls the method "PannerNode.setPosition"
  3155  // in a try/catch block and returns (_, err, ok = false) when it went through
  3156  // the catch clause.
  3157  func (this PannerNode) TrySetPosition(x float32, y float32, z float32) (ret js.Void, exception js.Any, ok bool) {
  3158  	ok = js.True == bindings.TryPannerNodeSetPosition(
  3159  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  3160  		float32(x),
  3161  		float32(y),
  3162  		float32(z),
  3163  	)
  3164  
  3165  	return
  3166  }
  3167  
  3168  // HasFuncSetOrientation returns true if the method "PannerNode.setOrientation" exists.
  3169  func (this PannerNode) HasFuncSetOrientation() bool {
  3170  	return js.True == bindings.HasFuncPannerNodeSetOrientation(
  3171  		this.ref,
  3172  	)
  3173  }
  3174  
  3175  // FuncSetOrientation returns the method "PannerNode.setOrientation".
  3176  func (this PannerNode) FuncSetOrientation() (fn js.Func[func(x float32, y float32, z float32)]) {
  3177  	bindings.FuncPannerNodeSetOrientation(
  3178  		this.ref, js.Pointer(&fn),
  3179  	)
  3180  	return
  3181  }
  3182  
  3183  // SetOrientation calls the method "PannerNode.setOrientation".
  3184  func (this PannerNode) SetOrientation(x float32, y float32, z float32) (ret js.Void) {
  3185  	bindings.CallPannerNodeSetOrientation(
  3186  		this.ref, js.Pointer(&ret),
  3187  		float32(x),
  3188  		float32(y),
  3189  		float32(z),
  3190  	)
  3191  
  3192  	return
  3193  }
  3194  
  3195  // TrySetOrientation calls the method "PannerNode.setOrientation"
  3196  // in a try/catch block and returns (_, err, ok = false) when it went through
  3197  // the catch clause.
  3198  func (this PannerNode) TrySetOrientation(x float32, y float32, z float32) (ret js.Void, exception js.Any, ok bool) {
  3199  	ok = js.True == bindings.TryPannerNodeSetOrientation(
  3200  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  3201  		float32(x),
  3202  		float32(y),
  3203  		float32(z),
  3204  	)
  3205  
  3206  	return
  3207  }
  3208  
  3209  type PeriodicWaveConstraints struct {
  3210  	// DisableNormalization is "PeriodicWaveConstraints.disableNormalization"
  3211  	//
  3212  	// Optional, defaults to false.
  3213  	//
  3214  	// NOTE: FFI_USE_DisableNormalization MUST be set to true to make this field effective.
  3215  	DisableNormalization bool
  3216  
  3217  	FFI_USE_DisableNormalization bool // for DisableNormalization.
  3218  
  3219  	FFI_USE bool
  3220  }
  3221  
  3222  // FromRef calls UpdateFrom and returns a PeriodicWaveConstraints with all fields set.
  3223  func (p PeriodicWaveConstraints) FromRef(ref js.Ref) PeriodicWaveConstraints {
  3224  	p.UpdateFrom(ref)
  3225  	return p
  3226  }
  3227  
  3228  // New creates a new PeriodicWaveConstraints in the application heap.
  3229  func (p PeriodicWaveConstraints) New() js.Ref {
  3230  	return bindings.PeriodicWaveConstraintsJSLoad(
  3231  		js.Pointer(&p), js.True, 0,
  3232  	)
  3233  }
  3234  
  3235  // UpdateFrom copies value of all fields of the heap object to p.
  3236  func (p *PeriodicWaveConstraints) UpdateFrom(ref js.Ref) {
  3237  	bindings.PeriodicWaveConstraintsJSStore(
  3238  		js.Pointer(p), ref,
  3239  	)
  3240  }
  3241  
  3242  // Update writes all fields of the p to the heap object referenced by ref.
  3243  func (p *PeriodicWaveConstraints) Update(ref js.Ref) {
  3244  	bindings.PeriodicWaveConstraintsJSLoad(
  3245  		js.Pointer(p), js.False, ref,
  3246  	)
  3247  }
  3248  
  3249  // FreeMembers frees fields with heap reference, if recursive is true
  3250  // free all heap references reachable from p.
  3251  func (p *PeriodicWaveConstraints) FreeMembers(recursive bool) {
  3252  }
  3253  
  3254  type ScriptProcessorNode struct {
  3255  	AudioNode
  3256  }
  3257  
  3258  func (this ScriptProcessorNode) Once() ScriptProcessorNode {
  3259  	this.ref.Once()
  3260  	return this
  3261  }
  3262  
  3263  func (this ScriptProcessorNode) Ref() js.Ref {
  3264  	return this.AudioNode.Ref()
  3265  }
  3266  
  3267  func (this ScriptProcessorNode) FromRef(ref js.Ref) ScriptProcessorNode {
  3268  	this.AudioNode = this.AudioNode.FromRef(ref)
  3269  	return this
  3270  }
  3271  
  3272  func (this ScriptProcessorNode) Free() {
  3273  	this.ref.Free()
  3274  }
  3275  
  3276  // BufferSize returns the value of property "ScriptProcessorNode.bufferSize".
  3277  //
  3278  // It returns ok=false if there is no such property.
  3279  func (this ScriptProcessorNode) BufferSize() (ret int32, ok bool) {
  3280  	ok = js.True == bindings.GetScriptProcessorNodeBufferSize(
  3281  		this.ref, js.Pointer(&ret),
  3282  	)
  3283  	return
  3284  }
  3285  
  3286  type StereoPannerOptions struct {
  3287  	// Pan is "StereoPannerOptions.pan"
  3288  	//
  3289  	// Optional, defaults to 0.
  3290  	//
  3291  	// NOTE: FFI_USE_Pan MUST be set to true to make this field effective.
  3292  	Pan float32
  3293  	// ChannelCount is "StereoPannerOptions.channelCount"
  3294  	//
  3295  	// Optional
  3296  	//
  3297  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
  3298  	ChannelCount uint32
  3299  	// ChannelCountMode is "StereoPannerOptions.channelCountMode"
  3300  	//
  3301  	// Optional
  3302  	ChannelCountMode ChannelCountMode
  3303  	// ChannelInterpretation is "StereoPannerOptions.channelInterpretation"
  3304  	//
  3305  	// Optional
  3306  	ChannelInterpretation ChannelInterpretation
  3307  
  3308  	FFI_USE_Pan          bool // for Pan.
  3309  	FFI_USE_ChannelCount bool // for ChannelCount.
  3310  
  3311  	FFI_USE bool
  3312  }
  3313  
  3314  // FromRef calls UpdateFrom and returns a StereoPannerOptions with all fields set.
  3315  func (p StereoPannerOptions) FromRef(ref js.Ref) StereoPannerOptions {
  3316  	p.UpdateFrom(ref)
  3317  	return p
  3318  }
  3319  
  3320  // New creates a new StereoPannerOptions in the application heap.
  3321  func (p StereoPannerOptions) New() js.Ref {
  3322  	return bindings.StereoPannerOptionsJSLoad(
  3323  		js.Pointer(&p), js.True, 0,
  3324  	)
  3325  }
  3326  
  3327  // UpdateFrom copies value of all fields of the heap object to p.
  3328  func (p *StereoPannerOptions) UpdateFrom(ref js.Ref) {
  3329  	bindings.StereoPannerOptionsJSStore(
  3330  		js.Pointer(p), ref,
  3331  	)
  3332  }
  3333  
  3334  // Update writes all fields of the p to the heap object referenced by ref.
  3335  func (p *StereoPannerOptions) Update(ref js.Ref) {
  3336  	bindings.StereoPannerOptionsJSLoad(
  3337  		js.Pointer(p), js.False, ref,
  3338  	)
  3339  }
  3340  
  3341  // FreeMembers frees fields with heap reference, if recursive is true
  3342  // free all heap references reachable from p.
  3343  func (p *StereoPannerOptions) FreeMembers(recursive bool) {
  3344  }
  3345  
  3346  func NewStereoPannerNode(context BaseAudioContext, options StereoPannerOptions) (ret StereoPannerNode) {
  3347  	ret.ref = bindings.NewStereoPannerNodeByStereoPannerNode(
  3348  		context.Ref(),
  3349  		js.Pointer(&options))
  3350  	return
  3351  }
  3352  
  3353  func NewStereoPannerNodeByStereoPannerNode1(context BaseAudioContext) (ret StereoPannerNode) {
  3354  	ret.ref = bindings.NewStereoPannerNodeByStereoPannerNode1(
  3355  		context.Ref())
  3356  	return
  3357  }
  3358  
  3359  type StereoPannerNode struct {
  3360  	AudioNode
  3361  }
  3362  
  3363  func (this StereoPannerNode) Once() StereoPannerNode {
  3364  	this.ref.Once()
  3365  	return this
  3366  }
  3367  
  3368  func (this StereoPannerNode) Ref() js.Ref {
  3369  	return this.AudioNode.Ref()
  3370  }
  3371  
  3372  func (this StereoPannerNode) FromRef(ref js.Ref) StereoPannerNode {
  3373  	this.AudioNode = this.AudioNode.FromRef(ref)
  3374  	return this
  3375  }
  3376  
  3377  func (this StereoPannerNode) Free() {
  3378  	this.ref.Free()
  3379  }
  3380  
  3381  // Pan returns the value of property "StereoPannerNode.pan".
  3382  //
  3383  // It returns ok=false if there is no such property.
  3384  func (this StereoPannerNode) Pan() (ret AudioParam, ok bool) {
  3385  	ok = js.True == bindings.GetStereoPannerNodePan(
  3386  		this.ref, js.Pointer(&ret),
  3387  	)
  3388  	return
  3389  }
  3390  
  3391  type OverSampleType uint32
  3392  
  3393  const (
  3394  	_ OverSampleType = iota
  3395  
  3396  	OverSampleType_NONE
  3397  	OverSampleType_2X
  3398  	OverSampleType_4X
  3399  )
  3400  
  3401  func (OverSampleType) FromRef(str js.Ref) OverSampleType {
  3402  	return OverSampleType(bindings.ConstOfOverSampleType(str))
  3403  }
  3404  
  3405  func (x OverSampleType) String() (string, bool) {
  3406  	switch x {
  3407  	case OverSampleType_NONE:
  3408  		return "none", true
  3409  	case OverSampleType_2X:
  3410  		return "2x", true
  3411  	case OverSampleType_4X:
  3412  		return "4x", true
  3413  	default:
  3414  		return "", false
  3415  	}
  3416  }
  3417  
  3418  type WaveShaperOptions struct {
  3419  	// Curve is "WaveShaperOptions.curve"
  3420  	//
  3421  	// Optional
  3422  	Curve js.Array[float32]
  3423  	// Oversample is "WaveShaperOptions.oversample"
  3424  	//
  3425  	// Optional, defaults to "none".
  3426  	Oversample OverSampleType
  3427  	// ChannelCount is "WaveShaperOptions.channelCount"
  3428  	//
  3429  	// Optional
  3430  	//
  3431  	// NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective.
  3432  	ChannelCount uint32
  3433  	// ChannelCountMode is "WaveShaperOptions.channelCountMode"
  3434  	//
  3435  	// Optional
  3436  	ChannelCountMode ChannelCountMode
  3437  	// ChannelInterpretation is "WaveShaperOptions.channelInterpretation"
  3438  	//
  3439  	// Optional
  3440  	ChannelInterpretation ChannelInterpretation
  3441  
  3442  	FFI_USE_ChannelCount bool // for ChannelCount.
  3443  
  3444  	FFI_USE bool
  3445  }
  3446  
  3447  // FromRef calls UpdateFrom and returns a WaveShaperOptions with all fields set.
  3448  func (p WaveShaperOptions) FromRef(ref js.Ref) WaveShaperOptions {
  3449  	p.UpdateFrom(ref)
  3450  	return p
  3451  }
  3452  
  3453  // New creates a new WaveShaperOptions in the application heap.
  3454  func (p WaveShaperOptions) New() js.Ref {
  3455  	return bindings.WaveShaperOptionsJSLoad(
  3456  		js.Pointer(&p), js.True, 0,
  3457  	)
  3458  }
  3459  
  3460  // UpdateFrom copies value of all fields of the heap object to p.
  3461  func (p *WaveShaperOptions) UpdateFrom(ref js.Ref) {
  3462  	bindings.WaveShaperOptionsJSStore(
  3463  		js.Pointer(p), ref,
  3464  	)
  3465  }
  3466  
  3467  // Update writes all fields of the p to the heap object referenced by ref.
  3468  func (p *WaveShaperOptions) Update(ref js.Ref) {
  3469  	bindings.WaveShaperOptionsJSLoad(
  3470  		js.Pointer(p), js.False, ref,
  3471  	)
  3472  }
  3473  
  3474  // FreeMembers frees fields with heap reference, if recursive is true
  3475  // free all heap references reachable from p.
  3476  func (p *WaveShaperOptions) FreeMembers(recursive bool) {
  3477  	js.Free(
  3478  		p.Curve.Ref(),
  3479  	)
  3480  	p.Curve = p.Curve.FromRef(js.Undefined)
  3481  }
  3482  
  3483  func NewWaveShaperNode(context BaseAudioContext, options WaveShaperOptions) (ret WaveShaperNode) {
  3484  	ret.ref = bindings.NewWaveShaperNodeByWaveShaperNode(
  3485  		context.Ref(),
  3486  		js.Pointer(&options))
  3487  	return
  3488  }
  3489  
  3490  func NewWaveShaperNodeByWaveShaperNode1(context BaseAudioContext) (ret WaveShaperNode) {
  3491  	ret.ref = bindings.NewWaveShaperNodeByWaveShaperNode1(
  3492  		context.Ref())
  3493  	return
  3494  }
  3495  
  3496  type WaveShaperNode struct {
  3497  	AudioNode
  3498  }
  3499  
  3500  func (this WaveShaperNode) Once() WaveShaperNode {
  3501  	this.ref.Once()
  3502  	return this
  3503  }
  3504  
  3505  func (this WaveShaperNode) Ref() js.Ref {
  3506  	return this.AudioNode.Ref()
  3507  }
  3508  
  3509  func (this WaveShaperNode) FromRef(ref js.Ref) WaveShaperNode {
  3510  	this.AudioNode = this.AudioNode.FromRef(ref)
  3511  	return this
  3512  }
  3513  
  3514  func (this WaveShaperNode) Free() {
  3515  	this.ref.Free()
  3516  }
  3517  
  3518  // Curve returns the value of property "WaveShaperNode.curve".
  3519  //
  3520  // It returns ok=false if there is no such property.
  3521  func (this WaveShaperNode) Curve() (ret js.TypedArray[float32], ok bool) {
  3522  	ok = js.True == bindings.GetWaveShaperNodeCurve(
  3523  		this.ref, js.Pointer(&ret),
  3524  	)
  3525  	return
  3526  }
  3527  
  3528  // SetCurve sets the value of property "WaveShaperNode.curve" to val.
  3529  //
  3530  // It returns false if the property cannot be set.
  3531  func (this WaveShaperNode) SetCurve(val js.TypedArray[float32]) bool {
  3532  	return js.True == bindings.SetWaveShaperNodeCurve(
  3533  		this.ref,
  3534  		val.Ref(),
  3535  	)
  3536  }
  3537  
  3538  // Oversample returns the value of property "WaveShaperNode.oversample".
  3539  //
  3540  // It returns ok=false if there is no such property.
  3541  func (this WaveShaperNode) Oversample() (ret OverSampleType, ok bool) {
  3542  	ok = js.True == bindings.GetWaveShaperNodeOversample(
  3543  		this.ref, js.Pointer(&ret),
  3544  	)
  3545  	return
  3546  }
  3547  
  3548  // SetOversample sets the value of property "WaveShaperNode.oversample" to val.
  3549  //
  3550  // It returns false if the property cannot be set.
  3551  func (this WaveShaperNode) SetOversample(val OverSampleType) bool {
  3552  	return js.True == bindings.SetWaveShaperNodeOversample(
  3553  		this.ref,
  3554  		uint32(val),
  3555  	)
  3556  }