Liquidsoap list.append用法

时间:2018-07-03 16:32:43

标签: audio streaming liquidsoap

我从动态资源示例脚本中获得了以下几行内容:

# Our custom request function
def get_request() = 
  # Get the URI
  allhttp = http.get("http://localhost:3000/getNextSongFileName")
  uri = snd(allhttp)
  log(uri)
  # Create a request
  request.create(uri)
end

# Create a function to create the playlist source and output it.
def create_playlist(ignore) =
  # The playlist source 
  s = request.dynamic(id="thelist",get_request)
  s = on_track(id="thelist",track_filename,s)
  s = amplify(v, s)

  #The output device might have to change depending on your configuration
  output = output.alsa(id='localAudio', device="hw: ALSA",fallible=true,s)

  # Save the playlist and the output to the array
  sourceAndoutput := 
      list.append( [s,output],
                    !sourceAndoutput )
  "Created!"
end

我试图了解list.append及其参数的用法。有人可以在使用过程中向我解释它吗?

我们为什么需要注册源?我已经使用不带list.append的动态源实现了类似的情况。那么,有什么意义呢?

0 个答案:

没有答案